Beispiel #1
0
        private void Page_PreInit(object sender, EventArgs e)
        {
            bool bPrintForm = false;

            if (Request.QueryString["Print"] != null)
            {
                bPrintForm = (Request.QueryString["Print"].ToString() == "Y");
            }

            if (bPrintForm)
            {
                this.MasterPageFile = "~/Print.master";
                Session[CONST_SESSION_SHEETISPRINTING] = "Y";
            }
            else
            {
                CheckBrowser _CheckBrowser    = new CheckBrowser();
                bool         _RunningOnMobile = _CheckBrowser.fBrowserIsMobile();
                Session[CheckBrowser.CONST_SESSION_RUNNINGONMOBILE] = _RunningOnMobile;

                if (_RunningOnMobile)
                {
                    this.MasterPageFile = "~/MobileSite.master";
                }
                else
                {
                    this.MasterPageFile = "~/Site.master";
                }
                Session[CONST_SESSION_SHEETISPRINTING] = "N";
            }
        }
Beispiel #2
0
        protected void Page_PreInit(object sender, EventArgs e)
        {
            CheckBrowser _CheckBrowser = new CheckBrowser();

            if (_CheckBrowser.fBrowserIsMobile())
            {
                this.MasterPageFile = "~/MobileSite.master";
            }
            else
            {
                this.MasterPageFile = "~/Site.master";
            }
        }
Beispiel #3
0
        protected void Session_Start(Object sender, EventArgs e)
        {
            try
            {
                if (Session["HomePath"] == null)
                {
                    Session["HomePath"]  = ConfigurationManager.AppSettings["HomePath"].ToString();    // Session["Homepath"] use to set root directory path and this path can be set from Web.config
                    Session["AdminPath"] = Session["HomePath"] + "Admin/";                             // Session["AdminPath"] use to set root directory path of admin folder
                    Session["StaticContentPhysicalPath"] = Session["HomePath"] + "StoreData/";
                    Session["MemberName"]    = null;                                                   // Session["MemberName"] Use to store member name display on home page
                    Session["IsLogin"]       = "******";                                                    // Session["IsLogin"] is use to check whether user is Loged in or not default Not
                    Session["UserType"]      = "4";                                                    // Session["UserType"] is use to set UseType 4 (Guest/Annonymus) ,1(Cat), 2(Dog) ,3(catDog)
                    Session["AdminUserType"] = "1";                                                    // Session["AdminUserType"] is user to set Admin user type 0 for admin and 1 for Subadmin
                    Session["MobilePath"]    = Session["HomePath"] + "mobileweb/";
                }
            }
            catch (SqlException ex) { throw ex; }

            if (Session["HomePath"] == null)
            {
                Session["HomePath"] = ConfigurationManager.AppSettings["HomePath"];
            }
            if (CheckBrowser.isMobileBrowser())
            {
                Session["Mobile"] = CheckBrowser.Mobile;
            }
            else
            {
                Session["Desktop"] = CheckBrowser.Desktop;
            }

            if (Convert.ToString(Session["Desktop"]) == "Desktop")
            {
                Uri    refUrl       = Request.UrlReferrer;
                string stringRefUrl = Convert.ToString(refUrl).ToLower();
                if (stringRefUrl.Contains("admin") == true)
                {
                    Response.Redirect("~/Admin/default.aspx");
                }
                else
                {
                    Response.Redirect("~/Index.aspx");
                }
            }

            else if (Convert.ToString(Session["Mobile"]) == "Mobile")
            {
                Response.Redirect("~/mobileweb/MB_index.aspx");
            }
        }
Beispiel #4
0
        protected void Page_PreInit(object sender, EventArgs e)
        {
            CheckBrowser _CheckBrowser    = new CheckBrowser();
            bool         _RunningOnMobile = _CheckBrowser.fBrowserIsMobile();

            Session[CheckBrowser.CONST_SESSION_RUNNINGONMOBILE] = _RunningOnMobile;

            if (_RunningOnMobile)
            {
                this.MasterPageFile = "~/MobileSite.master";
            }
            else
            {
                this.MasterPageFile = "~/Site.master";
            }
        }
Beispiel #5
0
        protected void Session_Start(Object sender, EventArgs e)
        {
            if (Session["HomePath"] == null)
            {
                Session["HomePath"] = ConfigurationManager.AppSettings["HomePath"];
            }

            if (CheckBrowser.isMobileBrowser())
            {
                Session["Style"]    = CheckBrowser.MobileCss;
                Session["HomePath"] = ConfigurationManager.AppSettings["HomePath"] + "mobileweb/";
            }
            else
            {
                Session["Style"] = CheckBrowser.DeviceCss;
            }
        }