默认不显示“表单管理”菜单
nnhy authored at 2012-02-15 17:13:52
1.03 KiB
X
using System;
using System.Web.UI.WebControls;
using NewLife.CommonEntity;
using NewLife.Web;

public partial class Center_Frame_Left : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ICommonManageProvider provider = CommonManageProvider.Provider;

            Int32 id = WebHelper.RequestInt("ID");

            IMenu m = provider.FindByMenuID(id);
            if (m != null) Literal1.Text = m.Name;

            menu.DataSource = provider.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 = CommonManageProvider.Provider.GetMySubMenus(m.ID);
        rp.DataBind();
    }
}