我使用jquery ajax发送用户名和密码,并返回结果,与GET方法完美配合,但使用post方法,它发送数据但不返回html结果,这是我的代码:
$.ajax({
type: "POST",
url: "panel.aspx",
data: username + ";" + pw,
success: function (result) {
$("#midiv").html(result);
}
});发布于 2012-08-12 23:26:01
尝试;
$.ajax({
type: 'POST',
url: 'panel.aspx',
data: {
'username=' + uname "&password=" + pword,
//Note:- uname and pword are variables and not text
},
success: function (result) {
$("#midiv").html(result);
}
});在你的aspx中,你可能会捕获类似这样的数据;
Dim uname, pword
uname = Request.Form("username")
pword = Request.Form("password")希望这能帮到你。
https://stackoverflow.com/questions/11923221
复制相似问题