欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-12-17 20:22:28
方法1:  c#  label1.text = request.form["txtname"].tostring();  vb.net  request.form("txt...
方法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下调试通过

上一篇:

下一篇: