C#
Label1.Text = Request.Form["txtName"].ToString();
vb.net
Request.Form("txtName").ToString()
方法2:
C#
System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form);Label1.Text = nc.GetValues("txtName")[0].ToString();
注: "txtName"为Html控件的"name"属性值
以上代码在Microsoft Visual Studio 2008下调试通过
本文转自左正博客园博客,原文链接:http://www.cnblogs.com/soundcode/archive/2011/04/06/2007283.html,如需转载请自行联系原作者