Try our conversational search powered by Generative AI!

MapContentRoute throws exception


I am trying to extend the episerver routing to add a /productid/ segment on the end of an episerver URL

I have added the following to my global asax

				"{language}/{node}/{partial}/{action}/{productid}", new
				partial = UrlParameter.Optional,
				action = UrlParameter.Optional,
				productId = UrlParameter.Optional


But it throws the following error when the application loads:

StructureMap Exception Code:  202
No Default Instance defined for PluginFamily System.Web.Routing.IRouteHandler, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

How do i fix this? and is the above route registration the correct approach?



Mar 26, 2013 15:42

I have seen this but all I need is to pass through a UrlParameter. I dont want to fetch any data based on the url, just pass it through to the controller.

Mar 26, 2013 15:59

Wrap your code in if(!ContentReference.IsNullOrEmpty(ContentReference.StartPage)).


Don't ask ;-)

Mar 26, 2013 16:03

Thanks Joel, that seems to work. I wasnt overriding the register routes method either, so thats in place now.

So the route registered and i can see it in my route table, but its 404 ing now.

im trying to access Http://localhost/uk/path/to/page/detail/p123

where /uk/ is a virtual directory

/path/to/page/ is the episerver url path

/detail/ is the action

and /p123 is my required parameter

any ideas?

Mar 26, 2013 18:34

just tried out the same code on another demo episerver site and it worked! not sure what else could be interfering.???

Mar 26, 2013 19:19
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.