Link to home
Start Free TrialLog in
Avatar of AWSHelpdesk
AWSHelpdesk

asked on

Combine MVC and .Net 4 Web Forms Routing

We are currently implementing some new functionality into our existing website which runs on a CMS that is .Net 4.

The CMS has it's own .Net 4 routing for it's user friendly URL's implemented through the CMS and also has a developer framework which allows us to create our own custom functionality.

We are creating this custom functionality on the MVC 3 framework using MVC routing.

I can successfully implement MVC routing if i have the .Net 4 routing turned off, but when i try and run them both together the MVC routing fails because the .Net 4 routing tries to implement it first (the .Net 4 one needs to run first because the code doing it does some other application related things on application start).

How can i get the call to the .Net 4 routing to ignore MVC routes?
Avatar of strickdd
strickdd
Flag of United States of America image

Unfortunately, you can't have both routing scenarios set up simultaneously. Your best bet would be to either have a folder exclusion rule in the CMS routing and put all your content under that folder and have it handled in MVC, but I'm not even sure if that would work the way you want.

The other option would be to create a subdomain or separate application for the MVC site.
In the global.ascx of the Webforms add this to where you register your routes.
I think the method is called RegisterRoutes

outes.IgnoreRoute("");
ASKER CERTIFIED SOLUTION
Avatar of Sammy
Sammy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial