Combine MVC and .Net 4 Web Forms Routing

Posted on 2011-05-02
Last Modified: 2012-06-27
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?
Question by:AWSHelpdesk
    LVL 28

    Expert Comment

    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.
    LVL 27

    Expert Comment

    In the global.ascx of the Webforms add this to where you register your routes.
    I think the method is called RegisterRoutes

    LVL 27

    Accepted Solution

    oops that was supposed to  be


    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Title # Comments Views Activity
    How to check if an MS Word is closed in C# 21 56
    network + 7 57
    Gridview Edit Row 10 33
    WMI, model #, retrieving information 10 52
    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now