Conditional display of image

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
3/14/2010 11:06:00 AM
Gravatar
Total Posts 2

Conditional display of image

Hello, I'd like to change header image depending on the page.

Tried to put a if() in the layout.Master masterpage, but can't get the page name. If I print the Page.GetType().Name, the app returns always default_aspx, no matter what url is there.

How can I know the page name?

Thanks!!!

3/14/2010 12:18:40 PM
Gravatar
Total Posts 18439

Re: Conditional display of image

Hi,

You should not add any code to layout.master directly. You could create a UserControl and add it to layout.master and put your code in the UserControl.

All CMS pages, that is pages listed in the menu are served by Default.aspx?pageid=x but we use url rewriting to keep a friendly url in the browser bar. From code you can get the url generally with Request.RawUrl, but realize that the home page will be shown with any of 3 urls like http://yoursiteroot/ or http://yoursiteroot/Default.aspx or http://yoursiteroot/home.aspx

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.