这是2003版的方法,但是在2005中就不行为什么啊!谢了!!!
login.htm
<form method="post" action="WebForm1.aspx">
<table style="width: 432px; height: 110px; text-align: center">
<tr>
<td style="width: 116px">
用户名:</td>
<td colspan="2">
<input id="txtUserName" type="text" /></td>
</tr>
<tr>
<td style="width: 116px">
密 码:</td>
<td colspan="2">
<input id="txtUserPwd" type="text" /></td>
</tr>
<tr>
<td align="center" colspan="3">
<input id="Submit1" type="submit" value="提交" /></td>
</tr>
</table>
</form>
WebForm1.aspx
protected void Page_Load(object sender, EventArgs e)
{
string userName = Request.Form.Get("txtUserName").ToString();
string userPwd = Request.Form.Get("txtUserPwd").ToString();
Response.Write("登录的用户名为:" + userName + ";密码为:" + userPwd);
}
[此贴子已经被作者于2007-2-1 9:25:14编辑过]