Let's first look at this example.
Front-endCode:
<ASP: textboxId = "textbox1" Runat="Server" Readonly="True" > </ASP: textbox>
Background code:
String text =Request. Form ["textbox1"].Trim ();
In. net2.0, when the readonly = "true" attribute is set for a textbox on the page,After being assigned a value through a client script, you cannot obtain this value when accessing the text attribute in the background code.After trying, we found that the problem can be solved in the following ways:
When we use a form to obtain a control in a form, we actually use the name. This is the initial principle of HTML. J2EE is used in this way. So how can we use ID in Asp.net? In fact, Asp.net automatically assigned the ID to the name.
However, a problem occurs:
If there is a nested condition, such as the master page and the gridview, the control name will change.Then we must first obtain the uniqueid.
String uid = this.txt birth. uniqueid;
String value = request. Form [uid]. Trim ();
Check the difference among ID, clientid, and uniqueid.Article:Http://blog.csdn.net/woshixuye/article/details/7259833