您的位置:首页 > Web前端 > JQuery

Jquery Ajax 调用后台方法

2012-08-29 17:25 197 查看
jQuery(function () {
jQuery("#fff").click(function (e) {
e.preventDefault();
var url = 'WebForm1.aspx' + "?rand=" + Math.random();
var str = "btnAjaxGet_click";
jQuery.post(url, { txtname: str }, function (data, static) {
if (data = "True") {

ShowUnknowMail();

}
});
});
});

function ShowUnknowMail()
{
if (!isWinExist("MailForUnknow"))
{
contentWin = new HWWeb("MailForUnknow");
contentWin.showWindow({ title: '', themeName: "alphacube", url: '../PlaceOrder/MailForUnknow.aspx', top: 200, left:220, width: 550 , height: 300});
}
else
{
alert("This window is open !");
}
}

if (!string.IsNullOrEmpty(Request["txtname"]))
{
string name = Request["txtname"];
if (name == "btnAjaxGet_click")
{
Response.Write("True"); //这是输出的返回值 data=true
//ajaxValue();
int i = BllLibrary.ajax(); //操作数据库
}
else
{
Response.Write("False");
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: