双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

Jquery 不执行后台方法! 求高手指教

色彩下牛 色彩下牛 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
 <script type="text/javascript">
$(document).ready(function() {
$("#<%=btnSearch.ClientID%>").click(function() {
var vusernamedesc = $("#<%=txtusernamedesc.ClientID%>").val();
var vcustomerid = $("#<%=txtcustomerid.ClientID%>").val();
var strjson = jquery.param({'usernamedesc':'vusernamedesc','customerid':'vcustomerid'});
$.ajax({
type: "POST",
url: "Ajax.ashx",
data: strjson,
success: function(strvalue) {
if (strvalue == "true") {
alert("OK");
}
else {
view(data.msg);
}
},
error: function() {
alert("异常");
}
});
});
});
</script>


————————————————————————————————————————
后台代码

using System;
using System.Web;

public class Ajax : IHttpHandler {

public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "application/json";
string struserDesc = context.Request.QueryString["usernamedesc"];
string strcustomerid = context.Request.QueryString["customerid"];
if (struserDesc == "" || strcustomerid == "")
{
string strQuery = "Select * from qxtdb.dbo.customer_login where username = '" + struserDesc + "' and customerid = '" + strcustomerid + "'";
}
}


...全文

相关推荐

评论 11
收藏 已收藏
分享
返回顶部
色彩下牛
Ajax 52,778 成员 25,334 内容