html页面代码- <form action ="index.aspx" method="post">
- 用户名称:<input name="username" type="text" />
- <br />
- 用户密码:<input name="userpwd" type="text" /><br />
- <br />
- <input name="Submit1" type="submit" value="提交" onclick="return Submit1_onclick()" />
- <input name="Reset2" type="reset" value="重置" />
- </form>
复制代码 然后aspx页面代码- protected void Page_Load(object sender, EventArgs e)
- {
- string userName = Request.Form["username"].ToString();
- string userPwd = Request.Form.Get("userpwd").ToString();
- Response.Write("用户名称:" + userName + "<br/>"+"用户密码:" + userPwd);
- }
复制代码 |