ASP .Net control name attribute

November 11th, 2011 by Mandisa Leave a reply »

FYI readers here is something the past me didn’t know that present me knows and blogging about.
You can never set name attribute on an asp .net control. You may try but at runtime it will be reset to be the same as the control ID. Please see example below.

 

asp:TextBox ID="txtName" name="CoderSetName" runat="server"

Will be set to:

input name="ctl00..$txtName" type="text" value=" " id=" ctl00..$txtName "
Advertisement

Leave a Reply