I have a themed page whereby the theme is chosen inside a http module.
public void context_PreRequestHandlerExecute(object sender, EventArgs e)
{
Page p = HttpContext.Current.Handler as Page;
if (p != null)
{
//get theme
string theme = GetTheme(HttpContext.Current.Request.Url.Host);
Debug.WriteLine(String.Format("Loading theme {0}", theme));
//set theme of page
p.Theme = theme;
}
}
Now when I request the elmah.axd the following exception is thrown:
Using themed css files requires a header control on the page. (e.g. ).
When I disable the http theme module everything is fine and elmah.axd page is shown. I think this is a small bug inside the ErrorLogPage. The ErrorLogPage should cope with the fact that a theme can be given to the page OR should ignore the given theme at all.
For now I use the workaround:
private const string ELMAH_ERROR_PAGE = "Elmah.ErrorLogPage";
if (p.GetType().FullName != ELMAH_ERROR_PAGE)
{
p.Theme = theme;
}
Do you have any better ideas or thoughts?
Gr
Martijn
The Netherlands