public static Control GetCurrentProfileControl() { //default var controlStr = "~/DesktopModules/CoreModules/SignIn/Signin.ascx"; PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; //Select the actual login page if (portalSettings.CustomSettings.ContainsKey("SITESETTINGS_LOGIN_TYPE")) { controlStr = Convert.ToString(portalSettings.CustomSettings["SITESETTINGS_LOGIN_TYPE"]); } System.Web.UI.Page x = new System.Web.UI.Page(); Control myControl = null;//x.LoadControl(SignInPage); try { myControl = x.LoadControl(controlStr); } catch (Exception exc) { ErrorHandler.Publish(LogLevel.Error, "The SignIn page from settings doesn't exists" ,exc); myControl = x.LoadControl("~/DesktopModules/CoreModules/SignIn/Signin.ascx"); } // End Modification by gman3001 PortalModuleControl p = ((PortalModuleControl)myControl); return ((Control)p); }
public static Control GetCurrentProfileControl() { //default var controlStr = "~/DesktopModules/CoreModules/SignIn/Signin.ascx"; PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; //Select the actual login page if (portalSettings.CustomSettings.ContainsKey("SITESETTINGS_LOGIN_TYPE")) { controlStr = Convert.ToString(portalSettings.CustomSettings["SITESETTINGS_LOGIN_TYPE"]); } System.Web.UI.Page x = new System.Web.UI.Page(); Control myControl = null;//x.LoadControl(SignInPage); try { myControl = x.LoadControl(controlStr); } catch (Exception exc) { ErrorHandler.Publish(LogLevel.Error, "The SignIn page from settings doesn't exists", exc); myControl = x.LoadControl("~/DesktopModules/CoreModules/SignIn/Signin.ascx"); } // End Modification by gman3001 PortalModuleControl p = ((PortalModuleControl)myControl); return((Control)p); }
/// <summary> /// Gets the current profile control. /// </summary> /// <returns></returns> public static Control GetCurrentProfileControl() { //default string RegisterPage = "Register.ascx"; // 19/08/2004 Jonathan Fong // www.gt.com.au AppleseedPrincipal user = HttpContext.Current.User as AppleseedPrincipal; PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; //Select the actual register page if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null && portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "Register.ascx") { RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString(); } System.Web.UI.Page x = new System.Web.UI.Page(); // Modified by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page int moduleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString()); string moduleDesktopSrc = string.Empty; if (moduleID > 0) { moduleDesktopSrc = Framework.Site.Configuration.ModuleSettings.GetModuleDesktopSrc(moduleID); } if (moduleDesktopSrc.Length == 0) { moduleDesktopSrc = RegisterPage; } Control myControl = x.LoadControl(moduleDesktopSrc); // End Modification by gman3001 PortalModuleControl p = ((PortalModuleControl)myControl); //p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString()); p.ModuleID = moduleID; if (p.ModuleID == 0) { ((SettingItem <bool, CheckBox>)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = false; } return((Control)p); }
/// <summary> /// Gets the current profile control. /// </summary> /// <returns></returns> public static Control GetCurrentProfileControl() { //default string RegisterPage = "Register.ascx"; // 19/08/2004 Jonathan Fong // www.gt.com.au AppleseedPrincipal user = HttpContext.Current.User as AppleseedPrincipal; PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"]; //Select the actual register page if (portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"] != null && portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString() != "Register.ascx") { RegisterPage = portalSettings.CustomSettings["SITESETTINGS_REGISTER_TYPE"].ToString(); } System.Web.UI.Page x = new System.Web.UI.Page(); // Modified by gman3001 10/06/2004, to support proper loading of a register module specified by 'Register Module ID' setting in the Portal Settings admin page int moduleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString()); string moduleDesktopSrc = string.Empty; if (moduleID > 0) moduleDesktopSrc = Framework.Site.Configuration.ModuleSettings.GetModuleDesktopSrc(moduleID); if (moduleDesktopSrc.Length == 0) moduleDesktopSrc = RegisterPage; Control myControl = x.LoadControl(moduleDesktopSrc); // End Modification by gman3001 PortalModuleControl p = ((PortalModuleControl)myControl); //p.ModuleID = int.Parse(portalSettings.CustomSettings["SITESETTINGS_REGISTER_MODULEID"].ToString()); p.ModuleID = moduleID; if (p.ModuleID == 0) { ((SettingItem<bool, CheckBox>)p.Settings["MODULESETTINGS_SHOW_TITLE"]).Value = false; } return ((Control)p); }