pothuri Posted December 2, 2003 Posted December 2, 2003 hii I was wondering whether its possible to pass a 'Panel' control as an argument to the function. I am trying to do that but gettin an compilaton error saying BC30577: 'AddressOf' operand must be the name of a method; no parentheses are needed in the aspx page: <asp:panel id="Panel1" Runat="server"></asp:panel> <asp:Button id="Load" Visible=False OnClick=loadd(Panel1) runat="server" Text="Load" ></asp:Button> in .vb page function loadd( ByVal pan As System.Web.UI.WebControls.Panel) dim y as integer= pan.controls.count .......... end function how should i proceed with this. thanks Quote
bungpeng Posted December 2, 2003 Posted December 2, 2003 What about if you remove the "OnClick=loadd(Panel1)" in your aspx file, then call 'loadd' function in your code-behind button onclick event. Do you get what I mean? It should work fine.... Quote
pothuri Posted December 2, 2003 Author Posted December 2, 2003 thanx for the reply as u said it worked. but i am not able to get the content of panel1 in that function. i.e am not able acess the controls i dynamically placed in that panel1. It gives me zero as output when i response.write( pan.controls.count). I dont know y it is not able to recognize those dynamically created controls in that panel1. Quote
bungpeng Posted December 2, 2003 Posted December 2, 2003 If you dynamically placed controls in that panel, you need to careful about the sequence. Is it the controls placed to panel first before you count your content (pan.controls.count)? Because logically it should work fine. Quote
pothuri Posted December 2, 2003 Author Posted December 2, 2003 what i did is i created controls(textboxes) dynamically using a function triggered by a button say 'create'. then i use a different button say 'get' to triggere a function which calculates the numb of controls i created and also their values. I think there is problem of maintaining state or some thing like that. i am not sure thanx Quote
mr relaxo Posted December 3, 2003 Posted December 3, 2003 this article may be helpful to you with regard to dynamically creating controls. Quote You can not get ye flask.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.