Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Themes (and skins) question.

Status
Not open for further replies.

Smeat

Programmer
Joined
Mar 27, 2004
Messages
193
Location
GB
I am using themes in a web application and using a querystring on the login page to decide which theme to apply.

Is there a way I can detect if the themeID supplied on the querystring corresponds to an existing theme so that I can use a default theme if it doesn't exist?

For instance:

string themeName = Request.QueryString["theme"];
if (themeName == null)
{
themeName = "Default";
}

//THIS IS WHERE I NEED HELP
if(theme exists then set it)
{
Page.Theme = themeName;
}
else
{
Page.Theme = "Default";
}

TIA

Smeat
 
How are the themes stored? Are they each in a seperate folder? If so, you may be able to just check to see if the folder exists.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
The themes are stored in the App_Themes folder.

I could read each file in all sub directories and look for the specific theme file though i'm hoping Microsoft have had the foresight to realise developers would benefit from gaining access to the themes collection.

Ta

Smeat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top