网站的表头部分的菜单是一个用户控件,在用户控件的Page_Load事件中,根据角色信息绑定相应的xml文件,来赋予不同权限用户不同的菜单  protected void Page_Load(object sender, EventArgs e)
    {                 lblLogName.Text = Context.User.Identity.Name;//显示登陆用户名,这个没有问题
            if (Page.User.IsInRole("admin"))
                xmldatasource.DataFile = "~/XML1.xml";            else if (Page.User.IsInRole("mid"))
                xmldatasource.DataFile = "~/XML2.xml";
            else if (Page.User.IsInRole("lower"))
                xmldatasource.DataFile = "~/XML3.xml";
            else
                    Response.Write("NotFound");
}