protected void LoadFooterCtrl(PlaceHolder plcHolder, ControlLocation CtrlKey) { string sControlPath = String.Empty; CarrotCakeConfig config = CarrotCakeConfig.GetConfig(); switch (CtrlKey) { case ControlLocation.PublicFooter: sControlPath = config.AdminFooterControls.ControlPathPublic; break; case ControlLocation.PopupFooter: sControlPath = config.AdminFooterControls.ControlPathPopup; break; case ControlLocation.MainFooter: sControlPath = config.AdminFooterControls.ControlPathMain; break; } if (!String.IsNullOrEmpty(sControlPath)) { if (File.Exists(Server.MapPath(sControlPath))) { Control ctrl = new Control(); ctrl = Page.LoadControl(sControlPath); plcHolder.Controls.Add(ctrl); } } }
protected void InsertSpecialCtrl(Control control, ControlLocation CtrlKey) { string sControlPath = String.Empty; CarrotCakeConfig config = CarrotCakeConfig.GetConfig(); switch (CtrlKey) { case ControlLocation.Header: sControlPath = config.PublicSiteControls.ControlPathHeader; break; case ControlLocation.Footer: sControlPath = config.PublicSiteControls.ControlPathFooter; break; } if (!String.IsNullOrEmpty(sControlPath)) { if (File.Exists(HttpContext.Current.Server.MapPath(sControlPath))) { Control ctrl = new Control(); ctrl = CurrentWebPage.LoadControl(sControlPath); control.Controls.Add(ctrl); } } }
public static string InsertSpecialView(ViewLocation CtrlKey) { string sViewPath = String.Empty; CarrotCakeConfig config = CarrotCakeConfig.GetConfig(); switch (CtrlKey) { case ViewLocation.AdminPublicFooter: sViewPath = config.AdminFooterControls.ViewPathPublic; break; case ViewLocation.AdminPopupFooter: sViewPath = config.AdminFooterControls.ViewPathPopup; break; case ViewLocation.AdminMainFooter: sViewPath = config.AdminFooterControls.ViewPathMain; break; case ViewLocation.PublicMainHeader: sViewPath = config.PublicSiteControls.ViewPathHeader; break; case ViewLocation.PublicMainFooter: sViewPath = config.PublicSiteControls.ViewPathFooter; break; } return(sViewPath); }