protected override void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { SitePreference sitePrefCache = CSFactory.GetCacheSitePref(); if (Request.Headers["X-HTTPS"] != null) { if (Request.Headers["X-HTTPS"].ToLower().Equals("no")) { if (Request.Url.ToString().Contains("www")) { Response.Redirect((Request.Url.ToString().Replace("http:/", "https:/").Replace("index.aspx", ""))); } else { Response.Redirect((Request.Url.ToString().Replace("http:/", "https:/").Replace("https://", "https://www.").Replace("index.aspx", ""))); } } } if (OrderHelper.IsMobileBrowser() && (Request.QueryString["mobile"] == null || (Request.QueryString["mobile"] != null && Request.QueryString["mobile"] != "false"))) { Response.Redirect("/mobile/?" + Request.QueryString.ToString().Replace("SID=DISPLAY", "SID=DISPLAY_MOB")); } if (CSBasePage.GetClientDeviceType() == CSBusiness.Enum.DeviceType.Tablet) // device mobile but version not mobile { Response.Redirect("/tablet_big3/" + ((Request.QueryString.ToString().Length > 0) ? "?" : "") + Request.QueryString.ToString().Replace("SID=DISPLAY", "SID=DISPLAY_TAB")); } NavigationControl.RouteTo("big1"); base.Page_Load(sender, e); } }
protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!IsPostBack) { if (CSBasePage.GetClientDeviceType() == CSBusiness.Enum.DeviceType.Mobile) { OrderHelper.MobileRedirect(); } string version = OrderHelper.GetVersionName().ToLower(); string strTermUrl = ""; strTermUrl = Request.Url.ToString().ToLower().Replace(":81", ""); OrderHelper.RedirectDesktop(); OrderHelper.SetDynamicLandingPageVersion(OrderHelper.GetVersionName(), ClientOrderData); // versionName used in Header.ascx string versioName = OrderHelper.GetVersionName().ToLower(); var qs = HttpUtility.ParseQueryString(Request.QueryString.ToString()); if (Request["sid"] == null || Request["sid"].Equals("")) { string sid = OrderHelper.GetDynamicVersionData("sid"); if (sid.Length > 0) { CommonHelper.SetCookie("sid", sid, new TimeSpan(1, 24, 1, 1)); qs.Set("sid", sid); if (Request.RawUrl.Contains("?")) { Response.Redirect(Request.RawUrl.Substring(0, Request.RawUrl.IndexOf('?')) + "?" + qs); } else { Response.Redirect(Request.RawUrl + "?" + qs); } } } else if (Response.Cookies["sid"] != null && Response.Cookies["sid"].Value != null && Response.Cookies["sid"].Value.Equals("1")) { string sid = OrderHelper.GetDynamicVersionData("sid"); if (sid.Length > 0) { CommonHelper.SetCookie("sid", sid, new TimeSpan(1, 24, 1, 1)); qs.Set("sid", sid); if (Request.RawUrl.Contains("?")) { Response.Redirect(Request.RawUrl.Substring(0, Request.RawUrl.IndexOf('?')) + "?" + qs); } else { Response.Redirect(Request.RawUrl + "?" + qs); } } } else if (Request["sid"] != null && DynamicSidDAL.GetDynamicsid(Request["sid"].ToLower()).Count == 0) { string sid = OrderHelper.GetDynamicVersionData("sid"); if (sid.Length > 0) { CommonHelper.SetCookie("sid", sid, new TimeSpan(1, 24, 1, 1)); qs.Set("sid", sid); if (Request.RawUrl.Contains("?")) { Response.Redirect(Request.RawUrl.Substring(0, Request.RawUrl.IndexOf('?')) + "?" + qs); } else { Response.Redirect(Request.RawUrl + "?" + qs); } } } else if (Request["sid"] != null && DynamicSidDAL.GetDynamicsid(Request["sid"].ToLower()).Count == 0 && !Request["sid"].ToLower().Equals(OrderHelper.GetDynamicVersionData("sid").ToLower())) { string sid = OrderHelper.GetDynamicVersionData("sid"); if (sid.Length > 0) { CommonHelper.SetCookie("sid", sid, new TimeSpan(1, 24, 1, 1)); qs.Remove("sid"); qs.Set("sid", sid); if (Request.RawUrl.Contains("?")) { Response.Redirect(Request.RawUrl.Substring(0, Request.RawUrl.IndexOf('?')) + "?" + qs); } else { Response.Redirect(Request.RawUrl + "?" + qs); } } } } }