How can I use the tag within an ASP.NET application? I want it to be valid, accessible, and usable.
I understand the optimal HTML way is t
If you are using .NET 4 you can now use the ClientIDMode property to configure one or more controls to use static or predictable ID's. The ClientIDMode property can be set on the TextBox directly or you can set it on any parent control or the containing page.
<label for="Username">Username:</label>
<asp:TextBox ID="Username" runat="server" ClientIDMode="Static" />
Read more about the ClientIDMode on MSDN
use the <asp:Label>
server control. It has a property that you can use to set the associated control ID.
<asp:Label ID="label1" runat="server" Text="Username" AssociatedControlID="Text1" />
<asp:TextBox ID="Text1" runat="server" />