Hi,
I would like to change the DNN skin/container dynamicly from my custom module based on some criteria (for example querystring)
I looked at the Skin.LoadSkin method, but this seems inaccessible since it is marked as private.
From dnn source I see that the sequence below is used to determine skin:
- Querystring
- cookie
- Page Skin
Any other options to overrule the LoadSkin method from my custom module on a per request base?
tx
private static Skin LoadSkin(PageBase page, string skinPath)
{
Skin ctlSkin = null;
try
{
string skinSrc = skinPath;
if (skinPath.ToLower().IndexOf(Globals.ApplicationPath, StringComparison.Ordinal) != -1)
{
skinPath = skinPath.Remove(0, Globals.ApplicationPath.Length);
}
ctlSkin = ControlUtilities.LoadControl<Skin>(page, skinPath);
ctlSkin.SkinSrc = skinSrc;
//call databind so that any server logic in the skin is executed
ctlSkin.DataBind();
}
catch (Exception exc)
{
//could not load user control
var lex = new PageLoadException("Unhandled error loading page.", exc);
if (TabPermissionController.CanAdminPage())
{
//only display the error to administrators
var skinError = (Label)page.FindControl("SkinError");
skinError.Text = string.Format(Localization.GetString("SkinLoadError", Localization.GlobalResourceFile), skinPath, page.Server.HtmlEncode(exc.Message));
skinError.Visible = true;
}
Exceptions.LogException(lex);
}
return ctlSkin;
}