November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
You should be able to get the routed data through extension method to RequestContext that resides in namespace EPiServer.Web.Routing:
var newsContent = Request.RequestContext.GetRoutedData<NewsContent>();
I have configured a partial route in a website which is using web form templates.
I have followed the tutorial on partial routing and am able to register a partial route which correctly loads my aspx template when the route is matched.
http://sdkbeta.episerver.com/SDK-html-Container/?path=/SdkDocuments/CMS/7/Knowledge%20Base/Developer%20Guide/Partial%20Routing/News%20partial%20routing%20example.htm&vppRoot=/SdkDocuments//CMS/7/Knowledge%20Base/Developer%20Guide/
I dont know the best way to access the custom route data from within the web form template.
Following the example in the SDK, if I where to create a webforms template to display a "NewsContent" item, the code behind I would look like this.
The code for accessing the route data works but is this correct / the best way? If this was a page, I would inherit TemplatePage<T> which gives typed access to the model, however I cannot do that here as NewsContent is not a page in the CMS.
Adam