菜鸟问题:Request传值问题~
小弟这两天刚在研究VS2005,碰到这个问题,自己琢磨了2个小时,实在是不知道哪的问题,请各位大侠帮忙~
1.login.htm内的form代码
<form method= "post " action= "Webform.aspx ">
<br />
<br />
<br />
<br />
<table border= "1 " cellpadding= "1 " cellspacing= "1 " style= "width: 293px ">
<tr>
<td style= "width: 89px; height: 21px ">
用户名: </td>
<td style= "width: 242px; height: 21px ">
<input id= "txtUserName " type= "text " /> </td>
</tr>
<tr>
<td style= "width: 89px ">
密码: </td>
<td style= "width: 242px ">
<input id= "txtUserPwd " type= "text " /> </td>
</tr>
<tr>
<td style= "width: 89px ">
</td>
<td style= "width: 242px ">
<input id= "Submit1 " type= "submit " value= "提交 " onclick= "return Submit1_onclick() " /> </td>
</tr>
</table>
</form>
2.Webform.aspx.cs内接收部分的代码
protected void Page_Load(object sender, EventArgs e)
{
string userName = Request[ "txtUserName "].ToString();