/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Page_Load(object sender, System.EventArgs e) { string path = PageHelper.GetRelativeLevel(); string scriptPath = path + "Platform/script"; ClientScript.RegisterClientScriptInclude("common", scriptPath + "/common.js"); ClientScript.RegisterClientScriptInclude("popMessage", scriptPath + "/PopMessage.js"); ClientScript.RegisterClientScriptInclude("message", scriptPath + "/Message.js"); string sc = string.Empty; switch (this.BrowserVersion) { case 6: sc = "/ModalWindow_ie6.js"; break; case 7: sc = "/ModalWindow_ie7.js"; break; default: sc = "/ModalWindow_ie6.js"; break; } CheckLogin(); ClientScript.RegisterClientScriptInclude("modalWindow", scriptPath + sc); }
private void Page_Load(object sender, System.EventArgs e) { //在IE6环境中,弹出页面时,是否显示水平滚动条 this.RemoveHorizontalScrollbar(this.ShowHorizontalScrollbar); string path = PageHelper.GetRelativeLevel(); string scriptPath = path + "Platform/script"; ClientScript.RegisterClientScriptInclude("common", scriptPath + "/common.js"); ClientScript.RegisterClientScriptInclude("popMessage", scriptPath + "/PopMessage.js"); ClientScript.RegisterClientScriptInclude("message", scriptPath + "/Message.js"); StringBuilder scri = new StringBuilder(); scri.AppendLine("setPageFirstFocus();"); if (this.AllowSetPageFirstFocus) { ClientScript.RegisterStartupScript(this.GetType(), "setFocus", scri.ToString(), true); } string sc = string.Empty; switch (this.BrowserVersion) { case 6: sc = "/ModalWindow_ie6.js"; break; case 7: sc = "/ModalWindow_ie7.js"; break; default: sc = "/ModalWindow_ie6.js"; break; } ClientScript.RegisterClientScriptInclude("modalWindow", scriptPath + sc); ClientScript.RegisterHiddenField("_lockDropdownlist", ""); CheckLogin(); //Toolbar载入样式,校验权限 RecursionLoadToolbar(this.Form.Controls); //UltraWebToolbar载入样式,校验权限 为老项目保留兼容性,新项目不用UltraWebToolbar控件 RecursionLoadUltraWebToolbar(this.Form.Controls); if (!this.IsPostBack) { } }
/// <summary> /// 检查是否登录 /// </summary> private void CheckLogin() { string checkLogin = System.Configuration.ConfigurationManager.AppSettings["checkLogin"]; if (checkLogin != null && (checkLogin == "0" || checkLogin.ToLower() == "false")) { return; } string path = PageHelper.GetRelativeLevel(); if (System.Web.HttpContext.Current.Session == null || System.Web.HttpContext.Current.Session.Count < 1) { ClientScript.RegisterClientScriptBlock(this.GetType(), "LoseSession", "<script>getDocument(true).location = \"" + path + "Default.aspx\";</script>"); } }