London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Weird Url generated by GetVirtualPathForNonContent

Vote:
 

I am trying to do some partial routing for my custom object, something similar to this: http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2012/11/Partial-Routing/

When I call UrlResolver.Current.GetVirtualPathForNonContent with my custom object, the url it generates is "currentpage/?routedData=MyCustomDataClass" and my IPartialRouter.GetPartialVirtualPath method is never called. Wonder what I'm missing? Bizarely, it works in edit mode (as in, my IPartialRouter is called and it generates the correct url)

#141794
Nov 20, 2015 10:47
Vote:
 

Hi Paul,


Did you register your path in the Initialisation module.

It should look something like this as below

public void Initialize(InitializationEngine context)        {     

      var partialRouter = new SharedNewsRouter();            
      RouteTable.Routes.RegisterPartialRouter(partialRouter);       
}

#141813
Nov 20, 2015 15:10
Vote:
 

Yes my IPartialRouter is registered and get's called when the page is rendered in edit mode, but not view mode.

#141814
Nov 20, 2015 15:19
Vote:
 

* BUMP *

#141874
Nov 23, 2015 15:54
* 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.