Boolean to test if in administration panel?
Posted: Wed Apr 29, 2009 9:44 pm
I have custom code in my global.asax file that I would want to only run in the public side, but not when an administrator is logged into the admin control panel. Right now I am figuring which side I am on like this:
One day someone can decide that they want to move the Admin files in a Secure folder, and this code would not work anymore. So is there a better, "native" way to test than to just check if I am in the Admin folder?
Code: Select all
if (!Request.FilePath.StartsWith("/Admin/"))
{
// Only change theme for public side
Page.Theme = "YellowJacket";
}