Use usual Javascript function in User Control |
Answered By
Moderator1
on
2/15/2008 7:54:34 PM |
|
|
Hi,
You can write usual javascript functions in the Web User Control between the <script></script> tag. The only thing you have to consider is the name of the controls.
That is to get a value of a Textbox which id is 'TextBox1', you usually use like
document.getElementById('TextBox1').value
But this will not work at all times. That is the client id may change in some situation. Better you can use the below syntax to overcome that situation.
document.getElementById('<%=TextBox1.ClientID%>').value
Thanks |
|
|