问C#的url和post,都是string,像url发送post希望得到回复的内容。

[复制链接]
查看11 | 回复3 | 2011-3-25 10:06:40 | 显示全部楼层 |阅读模式
on()
{
$('#myform').submit(function(){
jQuery.ajax({
url: "AsynchronousForm.aspx", // 提交的页面
data: $('#myform').serialize(), // 从表单中获取数据
type: "POST",
// 设置请求类型为"POST",默认为"GET"
beforeSend:
回复

使用道具 举报

千问 | 2011-3-25 10:06:40 | 显示全部楼层
你可以在定义url和post的时候将这两个变量设为null;然后再你要接收的地方判断。if(url!=null){//你要回复的内容。}思路是你建一个为空的字符串,当这个字符串不为空时就会回复内容。也不知道我理解的对不对
回复

使用道具 举报

千问 | 2011-3-25 10:06:40 | 显示全部楼层
using (System.Net.WebClient wc = new System.Net.WebClient())
{
string postParams = "name=Cat&password=123"; //要发送到URL的参数和对应的值
string
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行