为什么asp.net中控件的“name”属性在asp.net中默认取“id”值?
<%var ctrl =new HtmlInputText();
ctrl.ID = "ctrl_id";
ctrl.Name="ctrl_name";
StringBuilder sb = new StringBuilder();
System.IO.StringWriter sw = new System.IO.StringWriter(sb);
HtmlTextWriter writer = new HtmlTextWriter(sw);
ctrl.RenderControl(writer);%>
<%=sb.ToString()%>
上面的代码呈现了一个控件,但是 name 属性的值是“ctrl_id”而不是“ctrl_name”