• 使用AjaxPro


    1:后台注册

    protected void Page_Load(object sender, EventArgs e)
            {
                AjaxPro.Utility.RegisterTypeForAjax(typeof(SelectRoomByCommunity));
            }

    2:后台方法家标识

            /// <summary>
            /// 查询置顶小区
            /// </summary>
            /// <returns></returns>
            [AjaxPro.AjaxMethod]
            public List<RoomByCommunity> GetTopRoom(string co_autoid)
            {
                List<RoomByCommunity> lis = new List<RoomByCommunity>();
                lis = new RoomService().GetTopRoom(co_autoid);
    
                return lis;
            }

    3:前台方法调用

        //获取下一级Room
        function GetNextRom(RBC_AutoID) {
            $("#input_Return_SelectCommunity").show();
            var x = CRM.Page.crm.UserContronel.SelectRoomByCommunity.GetNextRoom(RBC_AutoID);
            $("#AreaList_SelectRoomByCommunity").html("")
            $(x.value).each(function(index, ele) {
                if (ele.RBC_IsLast == 1) {//最后一级
                    var topcom = '<a   onClick=GetRoomAddress("' + ele.RBC_AutoID + '","' + ele.RBC_Name + '")>' + ele.RBC_Name + '</a>';
                } else {
                    var topcom = '<a   onClick=GetNextRom("' + ele.RBC_AutoID + '")>' + ele.RBC_Name + '</a>';
                }
                $("#AreaList_SelectRoomByCommunity").html($("#AreaList_SelectRoomByCommunity").html() + topcom);
            });
            $("#AreaList_SelectRoomByCommunity").html($("#AreaList_SelectRoomByCommunity").html() + '<div class="clear"></div>');
        }

    4:web.config修改

            <httpHandlers>
          <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
            </httpHandlers>

    ==================================

    http://www.cnblogs.com/lexus/archive/2007/11/29/977281.html

  • 相关阅读:
    Ubuntu下errno值
    Git 经常使用命令总结
    【我们都爱Paul Hegarty】斯坦福IOS8公开课个人笔记38 Unwind Segue反向过渡
    高斯噪声
    小记5.8面试
    基数排序之多keyword排序运用队列
    广告贴
    输入字符串反序输出
    Codeforces Round #313 A. Currency System in Geraldion
    matlab中怎样加入凝视
  • 原文地址:https://www.cnblogs.com/PLifeCopyDown/p/3669212.html
Copyright © 2020-2023  润新知