.net 响应form请求
2016-07-12 13:01
218 查看
<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"]来接收;
相关文章推荐
- 如何在 Linux/Windows/MacOS 上使用 .NET 进行开发
- 如何在 Linux 中安装微软的 .NET Core SDK
- C#.NET获取拨号连接的宽带连接方法
- C#.Net ArrayList的使用方法
- PowerShell中使用.NET将程序集加入全局程序集缓存
- .net(c#)中的new关键字详细介绍
- 由vbs sort引发.NET Framework之间的关系说明
- C#难点逐个击破(6):C#数据类型与.net framework数据类型
- .NET中的async和await关键字使用及Task异步调用实例
- 基于.NET平台常用的框架和开源程序整理
- .Net中的json操作类用法分析
- .net实现序列化与反序列化实例解析
- .NET中的Timer类型用法详解
- Microsoft .Net Remoting系列教程之二:Marshal、Disconnect与生命周期以及跟踪服务
- 关于.net(C#)中的跨进程访问的问题
- .NET实现父窗体关闭而不影响子窗体的方法
- 基于.Net中的数字与日期格式化规则助记词的使用详解
- .NET微信公众号开发之公众号消息处理
- .Net下的签名与混淆图文分析
- .NET 扩展实现代码