|
-
Oct 29th, 2006, 07:34 PM
#1
Thread Starter
Fanatic Member
Can we access controls within user controls on the client side without using ctl0_Con
pb: Can we access controls within user controls on the client side without using ctl0_ControlsName
When we create controls within our user controls, the way we can access those controls in client side is i guess:
getElementByID('the client id')
but the server chnages the names of those controls to: clt0_Controlsname, so i always have to use add ctl0 when I want to access to my controls of the user control on the client side.
is there a solution to this or that s just the way it is
thank you
-
Oct 30th, 2006, 04:34 PM
#2
Re: Can we access controls within user controls on the client side without using ctl0_Con
You can generate the javascript you need using Page.RegisterStartupScript and Page.RegisterClientScriptBlock. These methods accept strings, and you needn't pass it _ctl0_controlname, you can pass it controlname.ClientID, which is a string property which you'll need to concatenate into your javascript.
If it's a centralized function, you can pass it as a javascript call, again through concatenation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|