加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajax方法未定义或为空

发布时间:2020-12-16 00:48:23 所属栏目:百科 来源:网络整理
导读:目前在用DWZ做个系统。 在后台界面中,注册了个ajax方法,现在要在前台界面中调用。 但是一直报错:找不到注册的这个方法。 后台代码: protected void Page_Load(object sender,EventArgs e) {AjaxPro.Utility.RegisterTypeForAjax(typeof(AA.BB.SysSetting

目前在用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的定义才报这个错误的。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读