Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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....

Posted

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.

Posted
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.
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...