后台得到HTML控件值

 第一种方法:

前台

<div>
        <select id="Select1" name="sel">
            <option selected="selected" value="1">1</option>
             <option selected="selected" value="2">2</option>
              <option selected="selected" value="3">3</option>
               <option selected="selected" value="4">4</option>
               <option selected="selected" value="5">5</option>
               <option selected="selected" value="6">6</option>
        </select>
        <input id="Text1" type="text" name="Text1"/>       
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>

后台

  Response.Write(Request.Form["sel"].ToString()+"<br>");
        Response.Write(Request.Form["Text1"].ToString());

第二种方法:  ajaxpro

前台

function Addint()
     {
       var tb1=document.getElementById('TextBox1').value;
       var tb2=document.getElementById('TextBox2').value;
       document.getElementById('TextBox3').value = ajaxSum.AddTwo(tb1,tb2).value;
     }

后台

 [AjaxPro.AjaxMethod]
    public string AddTwo(int firstInt, int secondInt)
    {
        return Convert.ToString(firstInt+secondInt);
    }

原文地址:https://www.cnblogs.com/freexiaoyu/p/1378311.html