protected void Page_Load(object sender, System.EventArgs e) { string text = (this.Page.RouteData.Values["custpath"] != null) ? this.Page.RouteData.Values["custpath"].ToString() : "notfound"; this.H_Page.CustomPagePath = text; CustomPage customPageByPath = CustomPageHelp.GetCustomPageByPath(text); if (customPageByPath == null) { base.Response.Redirect("/default.aspx"); } this.IsShowMenu = customPageByPath.IsShowMenu; string value = base.Request.QueryString["ReferralId"]; if (!string.IsNullOrEmpty(value)) { customPageByPath.PV++; CustomPageHelp.Update(customPageByPath); } if (!string.IsNullOrEmpty(customPageByPath.TempIndexName)) { this.cssSrc = this.cssSrc + customPageByPath.TempIndexName + "/css/head.css"; this.cssLinkStr = "<link rel=\"stylesheet\" href=\"" + this.cssSrc + "\">"; } this.siteSettings = SettingsManager.GetMasterSettings(true); this.htmlTitleName = customPageByPath.Name; this.Desc = customPageByPath.Details; string userAgent = this.Page.Request.UserAgent; if (!base.IsPostBack) { HiAffiliation.LoadPage(); string getCurrentWXOpenId = Globals.GetCurrentWXOpenId; int num = Globals.RequestQueryNum("go"); if (userAgent.ToLower().Contains("micromessenger") && string.IsNullOrEmpty(getCurrentWXOpenId) && this.siteSettings.IsValidationService && num != 1) { this.Page.Response.Redirect("Follow.aspx?ReferralId=" + Globals.GetCurrentDistributorId()); this.Page.Response.End(); } if (Globals.GetCurrentMemberUserId(false) == 0 && this.siteSettings.IsAutoToLogin && userAgent.ToLower().Contains("micromessenger")) { System.Uri arg_1DF_0 = System.Web.HttpContext.Current.Request.Url; string urlToEncode = Globals.GetWebUrlStart() + "/default.aspx?ReferralId=" + Globals.RequestQueryNum("ReferralId").ToString(); base.Response.Redirect("/UserLogining.aspx?returnUrl=" + Globals.UrlEncode(urlToEncode)); base.Response.End(); } this.showMenu = this.siteSettings.EnableShopMenu; this.BindWXInfo(); } }
protected void Page_Load(object sender, EventArgs e) { string custPath = Page.RouteData.Values["custpath"] != null ? Page.RouteData.Values["custpath"].ToString() : "notfound"; H_Page.CustomPagePath = custPath; var model = CustomPageHelp.GetCustomPageByPath(custPath); if (model == null) { Response.Redirect("/default.aspx"); } IsShowMenu = model.IsShowMenu; string reId = Request.QueryString["ReferralId"]; if (!string.IsNullOrEmpty(reId)) { model.PV += 1; CustomPageHelp.Update(model); } if (!string.IsNullOrEmpty(model.TempIndexName)) { cssSrc += model.TempIndexName + "/css/head.css"; cssLinkStr = "<link rel=\"stylesheet\" href=\"" + cssSrc + "\">"; } siteSettings = SettingsManager.GetMasterSettings(true); //ShowCopyRight = siteSettings.ShowCopyRight; htmlTitleName = model.Name; Desc = model.Details; string userAgent = Page.Request.UserAgent;//获取浏览器信息 //EnabeHomePageBottomLink = siteSettings.EnabeHomePageBottomLink;//控制底部菜单是否显示 //EnableHomePageBottomCopyright = siteSettings.EnableHomePageBottomCopyright;//控制是否显示版权信息 //EnableGuidePageSet = siteSettings.EnableGuidePageSet; //IsAutoGuide = siteSettings.IsAutoGuide; //IsMustConcern = siteSettings.IsMustConcern; //DistributionLinkName = siteSettings.DistributionLinkName;//分销申请栏目名称 //DistributionLink = string.IsNullOrEmpty(siteSettings.DistributionLink) ? "javascript:void(0);" : siteSettings.DistributionLink; //分销申请链接 //CopyrightLinkName = siteSettings.CopyrightLinkName;//版本信息文字 //CopyrightLink = string.IsNullOrEmpty(siteSettings.CopyrightLink) ? "javascript:void(0);" : siteSettings.CopyrightLink; //文字对应跳转链接 //if (siteSettings.EnableAliPayFuwuGuidePageSet) //{ // AlinfollowUrl = siteSettings.AliPayFuwuGuidePageSet;//服务窗口关注连接 //} //if (siteSettings.EnableGuidePageSet) //{ // WeixinfollowUrl = siteSettings.GuidePageSet; //微信关注连接 //} if (!IsPostBack) { HiAffiliation.LoadPage();//放在前面,防止参数丢失 string weiXinOpenID = Globals.GetCurrentWXOpenId; int goId = Globals.RequestQueryNum("go"); if (userAgent.ToLower().Contains("micromessenger") && string.IsNullOrEmpty(weiXinOpenID) && siteSettings.IsValidationService && goId != 1) //判断是否是在微信中打开 { Page.Response.Redirect("Follow.aspx?ReferralId=" + Globals.GetCurrentDistributorId()); Page.Response.End(); } int memberID = Globals.GetCurrentMemberUserId(); if (memberID == 0 && siteSettings.IsAutoToLogin && userAgent.ToLower().Contains("micromessenger"))//判断是否是在微信中打开 { Uri linkUri = HttpContext.Current.Request.Url; string toUrl = Globals.GetWebUrlStart() + "/default.aspx?ReferralId=" + Globals.RequestQueryNum("ReferralId").ToString(); Response.Redirect("/UserLogining.aspx?returnUrl=" + Globals.UrlEncode(toUrl)); Response.End(); } showMenu = siteSettings.EnableShopMenu; BindWXInfo(); } }