姓名:<input id="Txt_Value_Html" type="text" /><br />
        <asp:Button ID="Btn_GetValue" runat="server" onclick="Btn_GetValue_Click" Text="Get Value" />
如果得到ID为Txt_Value_Html中的值呢?

解决方案 »

  1.   

    这样就可以了改成服务器控件
      姓名: <input id="Txt_Value_Html" type="text" runat="server" /> <br /> 
            <asp:Button ID="Btn_GetValue" runat="server" onclick="Btn_GetValue_Click" Text="Get Value" /> 后台
       string str = Txt_Value_Html.Value.ToString();
      

  2.   

    你只要是post数据到页面了那就可以用下面的方法。
    string strTxtValue = Request.Form["Txt_Value_Html"].ToString();
      

  3.   

    这样的话,要提交到本页?是POST了?
      

  4.   

    呵呵,当然是了。你测试一下就知道了。要多Action才行。
      

  5.   

    string tt=Request.Form["Txt_Value_Html"].ToString(); 
    string tt=Request.QueryString["Txt_Value_Html"].ToString(); 
    string tt=Request.Params["Txt_Value_Html"].ToString();
    三种都可以,但要注意第三种,和上边两种不同...
      

  6.   

     for (int i = 0; i < this.form1.Controls.Count; i++)
     {
        if ((this.form1.Controls[i] is TextBox) && (this.form1.Controls[i] as TextBox).Visible)
        {
            Response.Write((this.form1.Controls[i] as TextBox).Text);
        }
     }
    试试