asp.net - Theme 'XXX' cannot be found in the application or global theme directories -
Text after "itemprop =" text ">
The users of my asp.net site allows to pick the topic they want from a list generated from the app_themes folder. From time to time, the theme's name is changed or deleted, any user has selected the name of the deleted topic (this is stored in a cookie), the exception will be obtained:
Theme 'XXX' application or global theme directory can not be found in stack trace: [HttpException (0x80004005): Theme 'test' can not be found in the application or global theme directory.] System.Web.Compilation.ThemeDirectoryCompiler.GetThemeBuildResultType (String theme name) + 9 20 system. Web. Collections. My directory compensator. GetThemeBuildResultType (HttpContext Reference, String THEMENAME) +73 System.Web.UI.Page.InitializeThemes () 8,699,455 System.Web.UI.Page.PerformPreInit () +38 System.Web.UI.Page.ProcessRequestMain (Boolean includedStagesBeforeAsyncPoint, Boolean includedStagesAfterAsyncPoint 282
Where is the best place to trap and handle this exception? In the Page_PreInit method where you assign topics, there is a pair of ways to deal with the following:
I usually store in the viewstate, so I do not have to check again every time, but if you are changing topics on the fly, you probably do this .
Comments
Post a Comment