Forum Discussion
Raymond_Morris_
Jul 25, 2006Nimbostratus
Need a constructor for C# web page?
I've been working with the code from the video example of the simple iControl app (Nice job, Joe. You are a rock star.) I'm trying to use C to write a .NET web page to show a read-only view. Since this is really my first attempt at writing code this way, I was hoping for some help.
I've used both VS .NET 2003 and VS 2005 with the same issue.
I was able to use the principals discussed in the video to overcome certificate erros, etc. However, when I compile I get an error when looping through and updating the list box (here is the code):
Node.ITCMCommonIPPortDefinition [] node_defs = node.get_node_server_list();
int [] state = node.get_state_ex(node_defs);
for(int i=0; i
{
lb_nodes.Items.Add(
Convert.ToBoolean(state[ i ]),
node_defs[ i ].address + ":" +node_defs[ i ].port.ToString());
}
This produces an error: "No overload for method 'Add' takes '2' arguments". My research suggests that I need to identify a constructor. Unfortunately, I'm not sure how that is done. Is there a reference that you can point me to?
I realize that for a read-only page, I don't need a CheckBoxList, but I was trying to stay close to the provided code and set myself up for bigger and better things in the future.
Thanks in advance,
Ray
- In the video, I used a CheckedListBox which has the following Add() method:
Add(object item); Add(object item, CheckState check); Add(object item, bool isChecked);
Add(object item)
private System.Windows.Forms.CheckedListBox lb_nodes; . . . //------------------------------------------------------------------------ // Loop over the items //------------------------------------------------------------------------ for(int i=0; i{ lb_nodes.Items.Add( node_defs[ i ].address + ":" +node_defs[ i ].port.ToString(), Convert.ToBoolean(state[ i ])); }
- Raymond_Morris_NimbostratusThanks Joe,
- Things are a bit off. In your first code segment
UInt64 build64(BigIP1.Node.ITCMLocalLBNode value) { return ((string)value.get_node_server_list()<<32)|(string)value.low; }
UInt64 build64(Pool.CommonULong64 value) { return ((ulong)value.high<<32)|(uint)value.low; }
Node.ITCMCommonIPPortDefinition [] node_defs = node.get_node_server_list();
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects