软件编程
位置:首页>> 软件编程>> C#编程>> .net后台获取html控件值的2种方法

.net后台获取html控件值的2种方法

  发布时间:2023-01-07 09:12:30 

标签:html,控件值

方法1:
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 2012下调试通过

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com