ASPX : Theme for error pages

I set Page.Theme = "someTheme" in the Pre-Init handler of my Error404 page, which is in a directory called "Error"
If this page is evoked, I get a further error:
    Could not find a part of the path 'E:\web\xxx\htdocs\entries\Errors\App_Themes'.
How do I specify that the App_Themes directory is at the same level as the Errors directory?
PhotoCompManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carlos VillegasFull Stack .NET DeveloperCommented:
Im not sure but if you try:
Page.Theme = "~someTheme"

Open in new window

0
Carlos VillegasFull Stack .NET DeveloperCommented:
Or
Page.Theme = "~\someTheme"
0
Alfred A.Commented:
It looks like Error folder is your "root" folder if you are getting that error.  I don't think you can easily move the  "Root/App_Theme" folder setup.  App_Theme folder is a special ASP.NET folder and it is a reserved name.  

http://msdn.microsoft.com/en-us/library/ex526337%28v=VS.90%29.aspx

When you do this for example, <%@ Page Theme="ThemeName" %>, ASP.NET knows exactly where to look because of the "Root/App_Themes" structure.  Intellisense will also list all available Themes when you try to put the theme name.

However, if you really are looking to override the location for App_Themes, check this link below:

http://www.joeaudette.com/overriding-the-location-for-app_themes.aspx

The link above is in C# but you can convert it to VB using conversion tools:

http://www.developerfusion.com/tools/convert/csharp-to-vb/

http://www.carlosag.net/Tools/CodeTranslator/

I hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

PhotoCompManagerAuthor Commented:
Alfred1..

I don't want to change the App_Themes location - it works fine for all the rest of the pages. It's just the pages in the another directory - Errors - that don't pick up the theme. These are redirected by <custom errors> in web config
0
Alfred A.Commented:
Is the Errors Directory a sub folder of your root website?

I have a old web site that has an Errors Folder at the same level as the App_Themes folder and the web pages in the Errors folder uses the Theme inside the App_Themes folder and it can access the theme.

By the way, the theme was set in the Page Directive part of the page source and not in code behind. I added the property Theme (eg. Theme="BlueButton") in the page directive.
0
Carlos VillegasFull Stack .NET DeveloperCommented:
0
PhotoCompManagerAuthor Commented:
The Errors folder is at the same level as App-Themes (ie just under the root). I have set the theme in the preInit event as it can vary, but "ordinary" pages find it OK (they are just under the root, though).
0
Alfred A.Commented:
OK.  Out of curiosity, I tried to reproduce your situation and everything seems to be working fine.  I setup the Theme in PreInit with the ErrorPage.aspx inside an Errors folder at the same level as the App_Theme.  it works just fine.  Have you tried setting the Theme property in the Page Directive something like this:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ErrorPage.aspx.vb" Inherits="TestApp1.ErrorPage" Theme="BlueTheme1" %>

Also, if theme is available, intellisense should have pick this up.  Check the image attached and focus on the part where I was in the process of putting the Theme.  You will see that intellisense shows the available theme to use.  In the image, BlueTheme1 was seen by intellisense.
IntellisenseInPageDirectiveTheme.JPG
0
PhotoCompManagerAuthor Commented:
Ah, but I set in the pre-init handler in code, not the Page directive

I think I'll have to abandon the idea - it's not really worth the effort!
0
PhotoCompManagerAuthor Commented:
No solution
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.