asp.net 发送的ajax 调用不到WebMethod ,调试的时候就没进入该方法内。求各位大仙帮忙看看,谢谢了……
前台代码如下:所在页面op_ckbm.aspx
$.ajax({
type: 'post',
url: 'op_ckbm.aspx/dw',
data: "{'bm_id':'" + $("#bm_id").val() + "','bm_mc':'" + $("#bm_mc").val() + "'}",
contentType: "application/json; charset=utf-8",
datatype: "json",
success: function(data) {
document.getElementById("jsz").innerHTML = data.d;
},
error: function() {
}
});
后台代码如下:所在页面op_ckbm.aspx 代码文件op_ckbm.aspx.cs
[WebMethod]
public static string dw(string bm_id, string bm_mc)
{
string dw_mc = "";
DataTable bm_table = DBHelper.DataTables("select dw_mc from bm_view_join_dw_view where bm_id='" + bm_id + "' and is_vaild=1 and is_current=1");
string dw_id = "";
if (bm_table.Rows.Count > 0)
{
dw_mc = bm_table.Rows[0][0].ToString() + ";" + bm_mc;
}
return dw_mc;
}
神不在的星期二
精慕HU