今天试了一下用request获取form中值的方法,跟asp还是有点不一样,总结了两种方法:
第一种:
(post)
string userName = Request["txtUserName"].ToString();
string passWord = Request["txtUserPwd"].ToString();
第二种:
(post)
string userName = Request.Form.Get("txtUserName").ToString();
string passWord = Request.Form.Get("txtUserPwd").ToString();
(get)
string userName = Request.QueryString["txtUserName"].ToString();
string passWord = Request.QueryString["txtUserPwd"].ToString();