how to redirecting to a certain page

Vote:
 

How do I redirect to a certain page which is a subpage of startpage? I tried the follwing without any better luck:

 

PageData pd = EPiServer.DataFactory.Instance.GetPage(EPiServer.Core.PageReference.StartPage);
  object thePage = pd.Property.Get("PageX");

#51267
May 31, 2011 9:29
Vote:
 

var pageRef=(pd.Property.Get("PageX") as PropertyPageReference);

if (!PageReference.IsNullOrEmpty(pageRef.PageLink))

{

Data pd2 = EPiServer.DataFactory.Instance.GetPage(pageRef.PageLink);

Response.Redirect(pd2.LinkURL,true);

}

 

But you need to know that its not allowed to redirect from the firstpage based on host

#51271
May 31, 2011 9:55
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.