How do I reference a server control in javascript?
<%=ServerControlID.ClientID%>
Yes that’s all you need . For Example suppose you have a asp.net textbox server control whose ID is “Textbox1″ . In your javascript code to get the value of the control you will use something like this
var myValue= document.getElementById('<%=TextBox1.ClientID%>').value;
No related posts.
Very useful, quick tip.
Great help dude…!!