| Author |
Message |
raph
Guest
|
Posted:
Thu Nov 10, 2005 5:51 pm Post subject:
How to know live or edit mode |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
 |
|
|
|
|