|
Home > Archive > Microsoft Content Management Server > January 2005 > Previous CMS page
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Joseph 2005-01-03, 5:50 pm |
| How do you reference a previous page. The current page
would be:
CmsHttpContext.Current
Thanks
| |
|
| We can use the server variable "HTTP_REFERRER".
In your template code,
//for first load when there's no previous page, this value is null
if (Request.ServerVariables["HTTP_REFERRER"] != null)
string previousPage = Request.ServerVariables["HTTP_REFERRER"].ToString();
HTH.
"Joseph" wrote:
> How do you reference a previous page. The current page
> would be:
>
> CmsHttpContext.Current
>
> Thanks
>
>
>
| |
|
| Forgot to add.... the server variable gives us the URL, but not the CMS HTTP
context for it. To get that, we have to check if the URL is from the same CMS
server (if it is possible to be referenced by other sites), then call the
Searches.GetByURL() method to get its context.
"fs" wrote:
[vbcol=seagreen]
> We can use the server variable "HTTP_REFERRER".
> In your template code,
>
> //for first load when there's no previous page, this value is null
> if (Request.ServerVariables["HTTP_REFERRER"] != null)
> string previousPage = Request.ServerVariables["HTTP_REFERRER"].ToString();
>
> HTH.
>
>
> "Joseph" wrote:
>
| |
| Joseph 2005-01-05, 5:53 pm |
| Thanks.. I have a conversion problem though. I'm getting
the following error.
Cannot convert
type 'Microsoft.ContentManagement.Publishing.ChannelItem'
to 'Microsoft.ContentManagement.Publishing.CmsHttpContext'
Heres what my code
if (Request.ServerVariables["HTTP_REFERRER"] != null)
{
string previousPage =
Request.ServerVariables["HTTP_REFERRER"];
CmsHttpContext
PostBackCmsContext =
CmsHttpContext.Current.Searches.GetByUrl(previousPage);
}
I'm trying to reference a previous login page so that the
user can login to that page and edit it. I'm doing it
from a channel in which I'm calling a script url manual
login aspx page.
>-----Original Message-----
>Forgot to add.... the server variable gives us the URL,
but not the CMS HTTP
>context for it. To get that, we have to check if the URL
is from the same CMS
>server (if it is possible to be referenced by other
sites), then call the
>Searches.GetByURL() method to get its context.
>
>
>
>"fs" wrote:
>
value is null[vbcol=seagreen]
["HTTP_REFERRER"].ToString();[vbcol=seagreen]
page[vbcol=seagreen]
>.
>
|
|
|
|
|