コード例 #1
0
 protected void LoadAction(string action)
 {
     try
     {
         if (IsAdmin || IsValidUserRight(action))
         {
             CommonBaseControl ctl = (CommonBaseControl)LoadControl("~/admin/modules/" + action + ".ascx");
             if (ctl != null)
             {
                 ContentPane.Controls.Add(ctl);
             }
         }
         else
         {
             CommonBaseControl ctl = (CommonBaseControl)LoadControl("~/admin/modules/forbidden.ascx");
             if (ctl != null)
             {
                 ContentPane.Controls.Add(ctl);
             }
             //Response.Redirect(Common.GenerateAdminUrl(action,"returnurl=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery)));
         }
     }
     catch (Exception ex)
     {
         //
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsLogined)
     {
         CommonBaseControl ctl = (CommonBaseControl)LoadControl("~/admin/modules/login.ascx");
         if (ctl != null)
         {
             ContentPane.Controls.Add(ctl);
         }
         else
         {
             throw new Exception("Không tìm thấy yêu cầu");
         }
     }
     else
     {
         if (Request.QueryString["mod"] != null)
         {
             LoadAction(Request.QueryString["mod"]);
         }
         //else LoadAction("summary");
     }
     //lkbLogout.Visible = IsIntenalUser;
     //hplChangePass.Visible = IsIntenalUser;
     main_menu1.Visible = IsIntenalUser;
 }