ajax方法未定义或为空

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值