漫漫技术人生路

C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在页面page_load(.cs)时要注册类库,

        //TODO: Register Cppe_Base for Ajax, only if any element in this layout can drag/drop sections.
        AjaxPro.Utility.RegisterTypeForAjax(typeof(Cppe_Base));

        //TODO: Register specific element for Ajax, only if any element in this layout has element specific ajax method.
        AjaxPro.Utility.RegisterTypeForAjax(typCppElement);
        AjaxPro.Utility.RegisterTypeForAjax(typeof(Cppg_ElementGadget_ScsnPlanOrgChart));
       
        而后在类库中要有一个空的构造方法。
       
        在定义的方法前要写上 [AjaxPro.AjaxMethod],修饰符为public
       
        其中的数据库联接要如下面的形式:
        string strDBConn = "Driver={SQL Server};Server=" + strCompanyDBServer + ";Database=" + strCompanyDBName + ";UID=" + strDBUser + ";PWD=";
       
        在js文件中调用:
        strTemp = SalaryCom.CompPlanner.CppElementScripts.Cppe_Stp_AddEditSeccessionPlan2.GetOrgUnitCode().value;
        (格式:名称空间.类名.方法)
       
        或者
        SalaryCom.CompPlanner.CppElementScripts.Cppe_Spl_ResourcePlanningOrgChartView.AjaxGenerateOrgChartFrame(arrParam, AjaxGenerateOrgChartFrame_CallBack);
function AjaxGenerateOrgChartFrame_CallBack(res)
{
  //此处的res= SalaryCom.CompPlanner.CppElementScripts.Cppe_Spl_ResourcePlanningOrgChartView.AjaxGenerateOrgChartFrame(arrParam.value.
}

posted on 2008-03-12 10:07  javaca88  阅读(339)  评论(0编辑  收藏  举报