Groups | Blog | Home
all groups > asp.net building controls > october 2003 >

asp.net building controls : JavaScript and Custom Controls


arulrajalivi NO[at]SPAM hotmail.com
10/20/2003 3:29:27 PM
Hi,

I have a custom control(Child Control). Basically it renders a table.
It contains a Button Control. During the Click event of the Button
control I want to validate the User Inputs in the server side, if the
validation fails I put the value into the Hidden Input control.

Now, Onthe window_onload event I want to access the Hidden Input
field. But the problem is, even if I assign the IDto the Hidden Input
control at runtime, the HTML shows a differnt ID(it's adding the Child
control name_ctl7 soon). Because of this I am not able to use the
Javascript document.getelementbyId() function to the value.

Any help will be appreciated.

Thanks
Andy Smith
10/21/2003 10:09:40 AM
Do not hardcode id's into your script associated with your
control. Check out this article I wrote on combining
script with custom controls:
http://weblogs.asp.net/asmith/posts/25465.aspx

__
Andy Smith

[quoted text, click to view]
AddThis Social Bookmark Button