日期:2014-05-19  浏览次数:20405 次

一个简单的ajax,帮我看看有什么问题.在线等.
if   (!IsPostBack)
                {
                       
                        Ajax.Utility.RegisterTypeForAjax(typeof(MasterData_pubLotTable_Set));  
                }

        [AjaxMethod()]
       
        public   string   GetDesc()
        {
                return   "11111111 ";        
        }

<script   language   = "javascript "   >
function   ShowDesc()
{        
        MasterData.MasterData_pubLotTable_Set.GetDesc(ShowDesc_callBack);
    //MasterData_pubLotTable_Set.GetDesc(ShowDesc_callBack);也试过.一样报错
}
function   ShowDesc_callBack(res)
{
        alert( 'ssssssss ');
        var   ShowlblDesc=document.getElementById   ( "lblCateGoryDesc ");        
        var   bRet=res.value;
        msg.innerHTML=bRet;
}
</script>

出错提示:MasterData_pubLotTable_Set未定义.
本文件在MasterData文件夹下.
环境:vs2005
第一个ajax,不好意思.

------解决方案--------------------
Ajax.Utility.RegisterTypeForAjax(typeof(MasterData_pubLotTable_Set));
把这里改成:
Ajax.Utility.RegisterTypeForAjax(typeof(MasterData.MasterData_pubLotTable_Set));
------解决方案--------------------
注意你的类名..和命名空间..