But there is one simply but yet dirty way of addressing HTML elements rendered by ASP.NET. Do you remember that you can assign the CssClass attribute to any server control? Do you remember the jQuery selector that allows you to retrieve the elements with the specified CSS class? So, we can use it!
The pattern is simple:
<asp:TextBox ID="txtStreet" runat="server" CssClass="txtStreet" />
You just add the CssClass attribute and give it a unique value. Then you can retrieve the value of the element or perform any other manipulation with jQuery:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way. My personal thoughts tend to change, hence the articles in this blog might not provide an accurate reflection of my present standpoint.
© Mike Borozdin