How to get current Render Type of the page?

Vote:
 

I noticed that on our web-site when page has a Stop publish date set up and gets expired - it disappears from the menus but is still being shown if one know the direct link to it.

I tried to hide the content and show some kind of "Page is unnaccessible" message by using

if (!CurrentPage.CheckPublishedStatus(PagePublishedStatus.Published))
{                
     PageContent.Visible = false;
     IfUnpublished.Visible = true;               
}

It works fine, the only problem is that you cannot see the content in the preview when in EditMode as well.

So now I need to see if I'm in the EditMode or not. If I understand correctly, the RenderType class exists specifically for this purpose, but I couldn't find the way to use it properly in the master page template.

Any ideas how I should have done this?

Thanx.

#47500
Jan 31, 2011 11:26
Vote:
 

if (Request["id"]!=null && Request["id"].Contains("_"))
{
//edit mode if you dont use page providers at least

}

#47516
Jan 31, 2011 14:43
Vote:
 

Cool. Thanx man.

#47526
Jan 31, 2011 17:06
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.