How to know live or edit mode
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
How to know live or edit mode

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
raph
Guest





Posted: Thu Nov 10, 2005 5:51 pm    Post subject: How to know live or edit mode Reply with quote

Hello,
I want to know if it's possible to know in code behind we can know if the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks
Back to top
Chester Ragel
Guest





Posted: Thu Nov 10, 2005 5:51 pm    Post subject: Re: How to know live or edit mode Reply with quote

Hi,

To check the page status you should check postings status. This is to check
the context mode. PublishingMode.Published is to check whether the context
is in published mode not update mode. If you want to check for update mode
you should change it to PublishingMode.Update.

Cheers,
Chester

"raph" <raph@discussions.microsoft.com> wrote in message
news:8B14C9BB-246E-4814-9C32-3FB13FB55814@microsoft.com...
Quote:
Hello,
I have try this but it doen't work.
PublishingMode.Published I think that it means that the page status is
Publish and don't mean that the page is in "Edit mode"

"Chester Ragel" wrote:

Hi,

Just do a condition check in page load,

if(CmsHttpContext.Current.Mode == PublishingMode.Published)
{
//live site
}
else
{
//you can check for other modes as well - check PublishingMode enum
}

Don't forget to reference Microsoft.ContentManagement.Publishing.dll

Cheers,
Chester.

"raph" <raph@discussions.microsoft.com> wrote in message
news:318AB17E-2D51-48C5-A7D2-FEE591EEED7F@microsoft.com...
Hello,
I want to know if it's possible to know in code behind we can know if
the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks


Back to top
raph
Guest





Posted: Thu Nov 10, 2005 5:51 pm    Post subject: Re: How to know live or edit mode Reply with quote

Hello,
I have try this but it doen't work.
PublishingMode.Published I think that it means that the page status is
Publish and don't mean that the page is in "Edit mode"

"Chester Ragel" wrote:

Quote:
Hi,

Just do a condition check in page load,

if(CmsHttpContext.Current.Mode == PublishingMode.Published)
{
//live site
}
else
{
//you can check for other modes as well - check PublishingMode enum
}

Don't forget to reference Microsoft.ContentManagement.Publishing.dll

Cheers,
Chester.

"raph" <raph@discussions.microsoft.com> wrote in message
news:318AB17E-2D51-48C5-A7D2-FEE591EEED7F@microsoft.com...
Hello,
I want to know if it's possible to know in code behind we can know if the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks


Back to top
Chester Ragel
Guest





Posted: Thu Nov 10, 2005 5:51 pm    Post subject: Re: How to know live or edit mode Reply with quote

Hi,

Just do a condition check in page load,

if(CmsHttpContext.Current.Mode == PublishingMode.Published)
{
//live site
}
else
{
//you can check for other modes as well - check PublishingMode enum
}

Don't forget to reference Microsoft.ContentManagement.Publishing.dll

Cheers,
Chester.

"raph" <raph@discussions.microsoft.com> wrote in message
news:318AB17E-2D51-48C5-A7D2-FEE591EEED7F@microsoft.com...
Quote:
Hello,
I want to know if it's possible to know in code behind we can know if the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks
Back to top
raph
Guest





Posted: Thu Nov 10, 2005 9:50 pm    Post subject: Re: How to know live or edit mode Reply with quote

thanks chester it's work

"Chester Ragel" wrote:

Quote:
Hi,

To check the page status you should check postings status. This is to check
the context mode. PublishingMode.Published is to check whether the context
is in published mode not update mode. If you want to check for update mode
you should change it to PublishingMode.Update.

Cheers,
Chester

"raph" <raph@discussions.microsoft.com> wrote in message
news:8B14C9BB-246E-4814-9C32-3FB13FB55814@microsoft.com...
Hello,
I have try this but it doen't work.
PublishingMode.Published I think that it means that the page status is
Publish and don't mean that the page is in "Edit mode"

"Chester Ragel" wrote:

Hi,

Just do a condition check in page load,

if(CmsHttpContext.Current.Mode == PublishingMode.Published)
{
//live site
}
else
{
//you can check for other modes as well - check PublishingMode enum
}

Don't forget to reference Microsoft.ContentManagement.Publishing.dll

Cheers,
Chester.

"raph" <raph@discussions.microsoft.com> wrote in message
news:318AB17E-2D51-48C5-A7D2-FEE591EEED7F@microsoft.com...
Hello,
I want to know if it's possible to know in code behind we can know if
the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks





Back to top
Stefan [MSFT]
Guest





Posted: Sun Nov 13, 2005 9:50 pm    Post subject: Re: How to know live or edit mode Reply with quote

Hi Raph,

actually it seems you are more looking for the current WebAuthorContext mode
than the Publishing mode.
Please check if WebAuthorContext.Current.Mode ==
WebAuthorContextMode.PresentationPublished.

Cheers,
Stefan


"raph" <raph@discussions.microsoft.com> schrieb im Newsbeitrag
news:318AB17E-2D51-48C5-A7D2-FEE591EEED7F@microsoft.com...
Quote:
Hello,
I want to know if it's possible to know in code behind we can know if the
current page is in "Live site" or "edit site"
I work in C# but the answer can be in VB .net ;-)

thanks
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB