private Control LoadControl(Business.UserControls userControl)
        {
            Page.Title = Language.GetString(userControl.ToString());
            string path = "~/" + userControl.ToString().Replace("_", "/") + ".ascx";

            return(LoadControl(path));
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Business.UserControls userControl = Business.UserControls.UI_Home;

            if (Request.Params["CallBack"] != null)
            {
                if (Request.Params["CallBack"] == "loadLogin")
                {
                    Session.Remove("UserName");
                    Session.Remove("UserGuid");
                }
            }

            if (Request.Params["c"] != null)
            {
                int controlID = Helper.RequestEncryptedInt(this, "c");

                try
                {
                    if (controlID == 0)
                    {
                        throw new Exception();
                    }

                    userControl = (Business.UserControls)controlID;
                }
                catch
                {
                    if (Session["SessionExpired"] == null)
                    {
                        Session["SessionExpired"] = true;
                        InlineScript = "relaodMainPage();";
                    }
                }
            }
            else
            {
                InlineScript = "relaodMainPage();";
            }

            if (InlineScript == string.Empty)
            {
                Control control = LoadControl(userControl);
                mainPanel.Controls.Add(control);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Business.UserControls userControl = Business.UserControls.UI_404;
            //Business.HelpUserControls helpUserControl = Business.HelpUserControls.UI_Help_Home;

            CheckDomain();

            if (Request.Params["h"] != null)
            {
                try
                {
                    HtmlTextWriter htmlContent = null;
                    Server.Execute("~/UI/AradITCInfo/" + Request.Params["h"], htmlContent);
                    Literal ltrHtmlContent = new Literal();
                    ltrHtmlContent.Text = htmlContent.ToString();
                    mainPanel.Controls.Add(ltrHtmlContent);
                }
                catch
                {
                    if (Session["SessionExpired"] == null)
                    {
                        Session["SessionExpired"] = true;
                        InlineScript = "relaodMainPage();";
                    }
                }
                return;
            }

            if (Request.Params["c"] != null)
            {
                if (Helper.RequestEncryptedInt(this, "c") > 0)
                {
                    int controlID = Helper.RequestEncryptedInt(this, "c");

                    try
                    {
                        if (controlID == 0)
                        {
                            throw new Exception();
                        }

                        userControl = (Business.UserControls)controlID;
                    }
                    catch
                    {
                        if (Session["SessionExpired"] == null)
                        {
                            Session["SessionExpired"] = true;
                            InlineScript = "relaodMainPage();";
                        }
                    }
                }
            }
            else
            {
                userControl = Business.UserControls.UI_404;
            }

            //if (Request.Params["p"] != null)
            //{
            //	if (Helper.RequestEncryptedInt(this, "p") > 0)
            //	{
            //		int controlID = Helper.RequestEncryptedInt(this, "p");

            //		try
            //		{
            //			if (controlID == 0)
            //				throw new Exception();

            //			helpUserControl = (Business.HelpUserControls)controlID;
            //		}
            //		catch
            //		{
            //			if (Session["SessionExpired"] == null)
            //			{
            //				Session["SessionExpired"] = true;
            //				InlineScript = "relaodMainPage();";
            //			}
            //		}
            //	}
            //}
            //else
            //	helpUserControl = Business.HelpUserControls.UI_Help_Home;

            //try
            //{
            if (InlineScript == string.Empty && Request.Params["c"] != null)
            {
                Control control = LoadControl(userControl);
                mainPanel.Controls.Add(control);
            }
            //}
            //catch
            //{
            //userControl = Business.UserControls.UI_Home;
            //Control control = LoadControl(userControl);
            //mainPanel.Controls.Add(control);
            //}

            //try
            //{
            //	if (InlineScript == string.Empty && Request.Params["p"] != null)
            //	{
            //		Control control = LoadHelpControl(helpUserControl);
            //		mainPanel.Controls.Add(control);
            //	}
            //}
            //catch
            //{
            //	helpUserControl = Business.HelpUserControls.UI_Help_UnderConstruction;
            //	Control control = LoadHelpControl(helpUserControl);
            //	mainPanel.Controls.Add(control);
            //}
        }