ajax方法未定义或为空

来源:互联网 发布:mac自带的远程桌面连接 编辑:程序博客网 时间:2024/06/05 20:22

目前在用DWZ做个系统。


在后台界面中,注册了个ajax方法,现在要在前台界面中调用。

但是一直报错:找不到注册的这个方法。


后台代码:

protected void Page_Load(object sender, EventArgs e) {AjaxPro.Utility.RegisterTypeForAjax(typeof(AA.BB.SysSetting.SalePrice.SellingPriceForm));}//[AjaxPro.AjaxMethod]public bool InsertUpdatePart(string agencyID, string agencyType, string productClass, string product, string describe, string salePrice) {bool inUpResult = false;try {SalePriceSvr salePriceSvr = new SalePriceSvr();salePriceSvr.Agency.Key.OID = Convert.ToInt32(agencyID);salePriceSvr.Agency.Key.OTYPE = agencyType;salePriceSvr.Price = Convert.ToDecimal(salePrice);salePriceSvr.InsertCommand();inUpResult = true;} catch (Exception) {}return inUpResult;}

前台js中调用的代码:


function AddUpdateGJ() {        var inUpResult = AA.BB.SysSetting.SalePrice.SellingPriceForm.InsertUpdatePart($("#txtAgencyID").val());          }

一直报错:找不到AA   未定义或为空

或者报错:找不到InsertUpdatePart方法



在网上找了很多解决方案,但是都不试用。



后来才发现,在前台.aspx界面中,一定要有form的定义。

这里就是没有form的定义才报这个错误的。

原创粉丝点击