<input type="text" id="txt3" name="txt3">
我想获取这个文本框的值 要怎么获取

解决方案 »

  1.   

    string   strInput   =   Request.Form["txt3"].ToString()   
      或者使用Javascript:document.getElementById(   'txt3'   )
      

  2.   

    这里面的txt3是什么  是id 还是name
      

  3.   


    如果想在后台.cs文件写取值
    方法1 在<input type="text" id="txt3" name="txt3">中加上runat="server"
          即<input type="text" id="txt3" name="txt3" runat="server">
          然后在.cs 文件写 this.txt3.value 就是它的值方法2
          string strInput = Request.Form["txt3"].ToString()  如果在.aspx 取值
          document.getElementById( 'txt3' ).value