zoukankan      html  css  js  c++  java
  • asp.net后台获取前台html控件的值的方法

      protected void Button1_Click(object sender, EventArgs e)
        
    {

            System.Collections.Specialized.NameValueCollection nc 
    = new System.Collections.Specialized.NameValueCollection(Request.Form);

            Response.Write(nc.GetValues(
    "txtname")[0].ToString());
        }

    此方法只能对<input type="text"  />等类型的控件数据进行获取,对于select控件,如果value和text不一样,只能获取value。

    ////////////////////////////////
    ////////Sixi. Let it be.../////
    //////////////////////////////

  • 相关阅读:
    CGCDSSQ
    100200H
    斗地主
    借教室
    bzoj 3743
    17B
    能量项链
    589
    16-求连续数组和最大
    15-幸运数组4、7
  • 原文地址:https://www.cnblogs.com/sixiweb/p/1364241.html
Copyright © 2011-2022 走看看