从通用实体类CommonEntity中移除Membership相关代码,Membership将有XCode支持。 升级Web为.Net 4.0,该模版不再支持.Net 2.0,页面aspx.cs代码将可以使用C# 4.0语法
nnhy authored at 2015-05-08 15:59:01
0.98 KiB
X
using System;
using System.Web.UI.WebControls;
using NewLife.CommonEntity;
using NewLife.Web;
using XCode.Membership;

public partial class Center_Frame_Left : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Int32 id = WebHelper.RequestInt("ID");

            IMenu m = ManageProvider.Menu.FindByID(id);
            if (m != null) Literal1.Text = m.Name;

            menu.DataSource = ManageProvider.Menu.GetMySubMenus(id);
            menu.DataBind();
        }
    }

    protected void menu_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item == null || e.Item.DataItem == null) return;
        IMenu m = e.Item.DataItem as IMenu;
        if (m == null) return;

        Repeater rp = e.Item.FindControl("menuItem") as Repeater;
        if (rp == null) return;

        rp.DataSource = ManageProvider.Menu.GetMySubMenus(m.ID);
        rp.DataBind();
    }
}