更新時間:2022-05-10 10:52:05 來源:動力節(jié)點 瀏覽1371次
動力節(jié)點小編來告訴大家Ajax調(diào)用后臺方法
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(); }
});
});
});
函數(shù) 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
{ alrt("這個窗口打開了!"); } }
if (!string.IsNullOrEmpty(Request["txtname"])) { string name = Request["txtname"]; if (name == "btnAjaxGet_click") { Response.Write("True");//這是輸出返回值 data=true//ajaxValue(); int i = BllLibrary.ajax();//操作數(shù)據(jù)庫 } else { Response.Write("False"); } }
初級 202925
初級 203221
初級 202629
初級 203743