My asp.net site allows users to pick the theme they want from a list generated from the app_themes folder. From time to time, themes are renamed or removed. Any user who has selected a deleted theme name (it is stored in a cookie) will get the exception:
Theme 'XXX' cannot be found in the application or global theme directories
Stack Trace:
[HttpException (0x80004005): Theme 'test' cannot be found in the application or global theme directories.]
System.Web.Compilation.ThemeDirectoryCompiler.GetThemeBuildResultType(String themeName) +920
System.Web.Compilation.ThemeDirectoryCompiler.GetThemeBuildResultType(HttpContext context, String themeName) +73
System.Web.UI.Page.InitializeThemes() +8699455
System.Web.UI.Page.PerformPreInit() +38
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
Where is the best place to trap and handle this exception?