Post方式传值
发送页:
<form id="form1"action = "WebForm1.aspx" method ="post"> <div> <input name ="txtname" type ="text" value ="awei" /> <input type = "submit" value ="提交到WebForm1.aspx" /> </div> </form>
接收页:
protected void Page_Load(object sender, EventArgs e) { if (Request.Form["txtname"] != null) { TextBox1.Text = Request.Form["txtname"]; } }
注意:<form>中不能带runat = "server",否则会不起作用。