protected void lnkRelogin_Click(object sender, EventArgs e) { try { GoodwaySSO.Sso.Singletion.LogoutUserStateEx(Session["PassCode"].ToString(), "PC.IE"); } catch { } WebPortalService.LogoutAndRedirect(); }
protected void Page_Load(object sender, EventArgs e) { string id = Request["id"]; string strAction = Request["action"]; IList <SysModule> ents = null; if (strAction == "logout") { WebPortalService.LogoutAndRedirect(); } if (!string.IsNullOrEmpty(id)) { if (id == "-1") { // WebPortalService.CurrentUserContext.UserInfo.UserID ents = WebPortalService.CurrentUserContext.AccessibleModules.Where(tent => tent.ApplicationID == "d0f7290f-914c-4de0-af68-3ca340209e11").ToList(); ents = ents.Where(tent => String.IsNullOrEmpty(tent.ParentID)).ToList(); ents = ents.OrderBy(tent => tent.SortIndex).ToList(); } else { ents = WebPortalService.CurrentUserContext.AccessibleModules.Where(tent => tent.ParentID == id).ToList(); ents = ents.OrderBy(tent => tent.SortIndex).ToList(); } int i = 0; string result = "["; foreach (SysModule smEnt in ents) { if (i != ents.Count - 1) { result += "{id:'" + smEnt.ModuleID + "',name:'" + smEnt.Name + "',leaf:'" + smEnt.IsLeaf + "',url:'" + smEnt.Url + "'},"; } else { result += "{id:'" + smEnt.ModuleID + "',name:'" + smEnt.Name + "',leaf:'" + smEnt.IsLeaf + "',url:'" + smEnt.Url + "'}"; } i++; } result += "]"; Response.Write(result); Response.End(); } }
protected void lnkRelogin_Click(object sender, EventArgs e) { WebPortalService.LogoutAndRedirect(); }
/// <summary> /// 初始化方法(先于Page_Load和OnLoad执行) /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { base.OnInit(e); this.EnableViewState = false; // 禁用ViewState // 判断是否异步请求 if (!String.IsNullOrEmpty(Request["AsyncReq"]) && Request["AsyncReq"].Trim().ToUpper() == "TRUE") { this.IsAsyncRequest = true; } else { if (IsAsyncPage) { PageState.Add("AsyncState", true); // 异步状态 Form.Attributes["async"] = "true"; } } try { if (IsCheckLogon) { WebPortalService.CheckLogon(); } if (!String.IsNullOrEmpty(PageKey) && IsCheckAuth) { WebPortalService.CheckAuth(PageKey); } } catch (SecurityException sex) { // 非异步请求转向 if (!IsAsyncRequest) { // 登出并导航到登录页面 WebPortalService.LogoutAndRedirect(); } else { throw sex; } } // 解包请求 this.unPackRequest(); if (!this.IsAsyncRequest) { if (this.containter == null && Form != null) { Form.Attributes.Add("aimctrl", AimFormCtrlTag); Form.Attributes.Add("dsname", FormDataKey); this.containter = new PageStateContainer(); this.Form.Controls.Add(containter); } } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { WebPortalService.LogoutAndRedirect("Login.aspx"); }