We are trying to write a form at ASP.net using visual studio.
We want to be able to control the final client side ID of elements so we can refer to them in the jquery code easily.
The regular ‘id’ attribute at ASP.net gets an odd prefix that we cannot control at the client side.
How can we fully control the final client side ID of an element?
Thank you!
IE:
<asp:TextBox ID="TBICDCode6" runat="server" Width="240">
I want to be able to refer to the text box using
$("#TBICDCode6");
If you are using ASP.NET 4.0, you can do this by setting
Control.ClientIDModetostaticOr, if you are using an older version of ASP.NET, try this.