理解Form中get和post的两种方式
来源:互联网 发布:索尼l36h挂起网络 编辑:程序博客网 时间:2024/05/12 01:09
1、使用POST方式:
客户端代码:
// Create XMLHttpRequest object
CreateXmlHttp();
// Build the URL to connect to
var url = "ValidateName.aspx";
// Open a connection to the server
xmlHttp.open("POST", url, true);
// Setup a function for the server to run when it's done
xmlHttp.onreadystatechange = callBack_CheckName;
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
// Send the request
xmlHttp.send("name=" + escape(name) );
后台如何接收参数:
Request.Form["name"]
2、使用Get方式:
客户端代码:
// Create XMLHttpRequest object
CreateXmlHttp();
// Build the URL to connect to
var url = "ValidateName.aspx?name=" + escape(name);
// Open a connection to the server
xmlHttp.open("GET", url, true);
// Setup a function for the server to run when it's done
xmlHttp.onreadystatechange = callBack_CheckName;
// Send the request
xmlHttp.send(null );
后台如何接收参数:
Request.QueryString["name"]
Request.QueryString从地址栏中获取值,Request.Form从表单中获取值
post方法地址栏中无参数显示,,将整个form表单提交
使用post方法
send.aspx
receive.aspx.cs
在页面上显示的地址http://localhost:5689/WebSite/receive.aspx
使用get方法
send.aspx
receives.aspx.cs
在地址栏中显示http://localhost:5689/WebSite/receives.aspx?txtname=kong&txtage=22
- 理解Form中get和post的两种方式
- 理解form的get和post
- 理解form的get和post
- 理解form的get和post
- 理解form的get和post
- 理解form的get和post(转载)
- android中post和get两种方式发送请求
- Android中post和get两种方式发送请求
- Form表单两种数据传输的方式——get和post的区别
- form中get和post的区别
- Form中 Post和Get的区别
- GET 和 POST两种调用方式
- GET和POST两种请求方式的区别
- 两种访问接口的方式(get和post)
- get和post两种提交方式的区 别
- 关于表单提交的两种方式,post和get
- post 和get 两种传输方式的归纳
- 浏览器使用的两种方式:POST和GET
- 网络视频:“狼真的来了”是反击还是跑?
- Ubuntu 内核编译(从网上下载后编译)
- 1.4.3 使用PowerDesigner建模
- 诺顿杀毒软件下载试用
- Android 1.5 SDK与SDK开发教程
- 理解Form中get和post的两种方式
- 三个和尚没水吃的后续故事 zz
- 四大展会将“亮剑”义乌 谱写贸易交流新“篇章”
- Web.config 详细说明
- 关于QT4数据动态显示的问题
- 绿色版飞信2008 启动时报错“无法注册类别...”的解决办法
- jframe 标题栏处理
- 网上开店三个经验:价格、口碑和安全
- 安装zend 一切正常,zend装上后不起效!