protected void Page_Load(object sender, EventArgs e)
        {
            string title = string.Empty, portalId = string.Empty, selectedTabId = string.Empty, createdTabId = string.Empty, createdTabPath = string.Empty,
                   contentItemKey = string.Empty, keyWords = string.Empty, lang = string.Empty, selectedTabControlPath = string.Empty;

            if (Request.QueryString["selectedTabId"] != null && Request.QueryString["selectedTabId"].ToString() != string.Empty)
            {
                selectedTabId = Request.QueryString["SelectedTabId"].ToString();
            }
            if (Request.QueryString["createdTabId"] != null && Request.QueryString["createdTabId"].ToString() != string.Empty)
            {
                createdTabId = Request.QueryString["createdTabId"].ToString();
            }
            if (Request.QueryString["createdTabPath"] != null && Request.QueryString["createdTabPath"].ToString() != string.Empty)
            {
                createdTabPath = Request.QueryString["createdTabPath"].ToString();
            }
            if (Request.QueryString["portalId"] != null && Request.QueryString["portalId"].ToString() != string.Empty)
            {
                portalId = Request.QueryString["portalId"].ToString();
            }
            if (Request.QueryString["contentItemKey"] != null && Request.QueryString["contentItemKey"].ToString() != string.Empty)
            {
                contentItemKey = Request.QueryString["contentItemKey"].ToString();
            }
            if (Request.QueryString["keyWords"] != null && Request.QueryString["keyWords"].ToString() != string.Empty)
            {
                keyWords = Request.QueryString["keyWords"].ToString();
            }
            if (Request.QueryString["lang"] != null && Request.QueryString["lang"].ToString() != string.Empty)
            {
                lang = Request.QueryString["lang"].ToString();
            }


            aspnet_Tab entity = TabController.GetTabPathByTabId(Convert.ToInt32(selectedTabId));

            title = entity.Title;
            selectedTabControlPath = "/" + ConfigurationManager.AppSettings["admin_folder"] + entity.TabPath;

            if (File.Exists(Server.MapPath(selectedTabControlPath)))
            {
                loadUserControlToPlaceHolder(PlaceHolder1, selectedTabControlPath);
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserId != string.Empty)
            {
                string TabPath = string.Empty, page_url = string.Empty, title = string.Empty; int tabid = 1;
                if (Page.RouteData.Values.Count > 0)
                {
                    string strTabId = Page.RouteData.Values["tabid"].ToString();
                    if (!string.IsNullOrEmpty(strTabId))
                    {
                        tabid = Convert.ToInt32(strTabId);
                        PopulateNavigationSteps(tabid);

                        aspnet_Tab entity = TabController.GetTabPathByTabId(tabid);
                        TabPath  = System.Text.RegularExpressions.Regex.Replace(entity.TabPath, @"\s+", " ").Trim();
                        page_url = "/" + ConfigurationManager.AppSettings["admin_folder"] + TabPath;
                        if (File.Exists(Server.MapPath(page_url)))
                        {
                            loadUserControlToPlaceHolder(PlaceHolder1, page_url);
                        }
                        else
                        {
                            string scriptCode = "<script>alert('Không tồn tại đường dẫn này.');</script>";
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
                        }
                    }
                    else
                    {
                        string scriptCode = "<script>alert('Không tìm thấy tham số cần truyền');</script>";
                        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
                    }
                }
                else
                {
                    string scriptCode = "<script>alert('Không tìm thấy tham số truyền vào');</script>";
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
                }
            }
            else
            {
                Response.RedirectToRoutePermanent("admin_login");
            }
        }