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);
}
}
}