兄弟,你确定你在使用AjaxProcess.ajax_watertotal().value的时候,AjaxProcess已经初始化了。。就是这对象存在了?

解决方案 »

  1.   

    protected void Page_Load(object sender, EventArgs e)
            {
                //AJAX注册
                Ajax.Utility.RegisterTypeForAjax(typeof(AjaxProcess));
            }初始化了啊
      

  2.   

    只想说明一下我的经历,在后台的方法里,如不取服务器控件的值,则成功,如取了则 null,说白了,用起来要小心,不是什么都能做的
      

  3.   

    protected void Page_Load(object sender, EventArgs e) 
            { 
                //AJAX注册 
                Ajax.Utility.RegisterTypeForAjax(typeof(AjaxProcess)); 
            } 你这是在加载方法里啊,你的那个AjaxProcess.ajax_watertotal().value不是在方法里的啊,不在方法里的代码会在加载方法之前执行的
      

  4.   

    其实第一段代码是放在页面的里,是js,它的CodeBehind文件里
    protected void Page_Load(object sender, EventArgs e)
            {
                //AJAX注册
                Ajax.Utility.RegisterTypeForAjax(typeof(AjaxProcess));
            } 
    下面二段代码是AjaxProcess.cs中的
      

  5.   

    如果AjaxProcess没初始化了
    程序就不会进入
    [Ajax.AjaxMethod()]//返回要更新水印图片的进度条操作总数
    public int ajax_watertotal()
    {
                Jedsoft.BLL.Products bll = new Jedsoft.BLL.Products();
                Double nums = Convert.ToDouble(bll.GetCount()) / Convert.ToDouble(ConfigHelper.GetConfigString("ActionSpeed").ToString());
                int totals = Convert.ToInt32(Math.Floor(nums) + 1);
                return totals;
    }[Ajax.AjaxMethod()]//返回已经更新水印图片的进度条操作总数
    public int ajax_wateredtotal()
    {
                Jedsoft.BLL.Products bll = new Jedsoft.BLL.Products();
                Double nums = Convert.ToDouble(bll.GetCount_Watered()) / Convert.ToDouble(ConfigHelper.GetConfigString("ActionSpeed").ToString());
                int totals = Convert.ToInt32(Math.Floor(nums) + 1);
                return totals;
    }
    也得不到totals值 。
    可现在totals值能得到,可一返回,再赋值,竟然是null