Try our conversational search powered by Generative AI!

RequestContext.GetContentLink returns null

Vote:
 

Hi all,

I'm trying to implement a localizable errorpage using the tutorial of Karoline Klever, and this seems to be working okay-ish. For some reason, however, I am getting back null when I try to use the function public static ContentReference GetContentLink(this RequestContext reqContext) from EPiServer.Web.Routing.RequestContextExtension. This means the whole site still fails to render.

As said in the linked tutorial, I did set

ControllerContext.RouteData.DataTokens[RoutingConstants.NodeKey] = errorPage.ContentLink;

But that doesn't seem to be enough for EPiServer 7.5 (we're using EPiServer 7.6.3). What else do I need to do to make this work properly?

Regards,
PatrickBregman

#117138
Feb 12, 2015 10:14
Vote:
 

Hi Patrick,

You have probably solved your problem by now, if you havent, try adding this:

ControllerContext.RequestContext.RouteData.DataTokens[RoutingConstants.NodeKey] = errorPage.ContentLink;

Regards,
Robert

#118286
Mar 03, 2015 21:13
Vote:
 

I totally forgot to post that solution! But yeah, that solved it.

Thanks,
Patrick

#118299
Mar 04, 2015 7:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.