Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

CurrentPage after migrating 4.62 -> 5

Vote:
 

Example

CurrentPage.LinkURL is always null.
String s = new PageData(PageReference.StartPage).LinkURL works.

Any ideas?

#33456
Oct 13, 2009 20:39
Vote:
 
Does String s = new PageData(CurrentPage.PageLink).LinkURL work?
#33467
Oct 14, 2009 10:28
Vote:
 

Sorry...

The CurrentPage object itself is always null, not the properties.

In default.aspx (startpage) I have to write:
PageData startPage = new PageData(PageReference.StartPage);

PageData startPage = CurrentPage <- does not work.

I have also tried copying web.config from a working project (not migrated) and have made sure that the correct assemblies and versions are accessed.

The problem occurs on every page with/without masterpage and even if all I do is:

public partial class defaultRedesign : TemplatePage {
protected void Page_Load(object sender, EventArgs e) {
Response.Write(CurrentPage.LinkURL);

This is EPiServer 5.2.375.7 (due to migration).

#33476
Oct 14, 2009 11:29
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.