Label for input in ASP.NET
Another ASP.NET 2 "secret" for you, this one courtesy of Ben Wards presentation at BarCamp.
AssociatedControlID will automatically write out the for attribute on the label. Saves you waiting till PreRender to get the right ClientId, and keeps UI logic where it should be. Obviously it's a label element and not a span which is what asp:label normally writes out.
AssociatedControlID will automatically write out the for attribute on the label. Saves you waiting till PreRender to get the right ClientId, and keeps UI logic where it should be. Obviously it's a label element and not a span which is what asp:label normally writes out.
Labels: aspnet


Comment Feed


Nabeel
Thom Shannon
Michael James