.net 响应form请求

来源:互联网 发布:m1216nfh 网络扫描 编辑:程序博客网 时间:2024/06/05 16:09
<form action="http://localhost:6069/index.aspx" method="post"><input type="text" name="name" /><input type="tel" name="tel"/><input type="text" name="age"/><input type="submit" text="提交" /></form>

 if (Request.Form["name"] != null && Request.Form["tel"] != null)            {                string name = Request.Form["name"];                string tel = Request.Form["tel"];                if (name.Length > 3 && tel.Length == 11)                {                    Response.Write("OK");                }                else                {                    Response.Write("姓名:" + name + "  手机:" + tel);                }            }


以上是Post提交方式,如果使用Get提交方式后台需要用Request..QueryString["name"]来接收;


0 0