Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6729167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:15:25+00:00 2026-05-26T10:15:25+00:00

I read have most if not all of the various articles on adding MVC

  • 0

I read have most if not all of the various articles on adding MVC 3 to existing webforms sites. I have made the changes to the webforms site’s global asax to support MVC as well changes to web.config. However there are still some issues.

  1. MVC 3 is greedy – By default it takes over the root of the site so that navigate to the root i go to the entry page for mvc and not the webforms page which is what i want. To be clear when navigating to the root, i want it to go to mysite.com/default.aspx. To fix site root i add

    routes.MapPageRoute(“SiteRoot”, “”, “~/Default.aspx”)
    However this then breaks the MVC urls such that i end up with messed up urls like

    http://localhost:86/default?action=Index&controller=Blog
    How can i fix it so that the site root goes to webforms default.aspx and still have my MVC urls be correct?

  2. MVC 3 breaks a ccouple of HttpHandlers that the webform uses. Specifically, I use a handler to add far future expires headers to images and a resource handler to combine stylesheets and javascript files. The sheer presence of any route in RegisterRoutes breaks these handlers so that stylesheets dont load via the resource handler, and i lose the far future expires, and there is a httpcompression module that stops working too. So how do I maintain my httphandlers and modules for the webforms while still retaining the routes for MVC 3 portion of the site?

These 2 issues i have not seen anyone address in the various blog posts regarding mixing MVC3 and webforms.

Oh and i have routes.IgnoreRoute(“{resource}.aspx/{*pathInfo}”) in global.asax. The resource handler uses an aspx file extension so I would think then withthis exclusion in global that the hanlder would work but i guess not.

Another option i know is to set up a folder inside the wbeforms site and run it as its own appllication starting point – however i end up with a url i dont really want such as site.com/blog/blog/index where the 1st blog is the folder running as its own application point and the second blog is the controller.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:15:26+00:00Added an answer on May 26, 2026 at 10:15 am

    The best solution that I can find is to not mix MVC 3 with the existing webforms site. Instead set the MVC directory as its own app starting point and then run the MVC from that folder so that it and the existing webforms app are completely ignorant of each other. In this fashion, the resource handler and httpmodules and other handlers all still work for the webforms site. And this way the domain root goes to webforms default.aspx and not MVC by default. Also i dont have to put that entry into global.asax which in turn screwed up the mvc 3 urls. The next issue was to deal with the urls so that i didnt have a url lke blog/blog/post/1. To fix this i changed the html action link to

    @Html.ActionLink(item.PostTitle, "Post", New With {.id = item.PostId}, Nothing)
    

    And then make a change to global.asax – change the default route to (simply delete {controller}:

    routes.MapRoute( _
            "Default", _
            "{action}/{id}", _
            New With {.controller = "Blog", .action = "Index", .id = UrlParameter.Optional}, New String() {"RiderDesignMvcBlog.Core.Controllers"})
    

    So now instead of blog/blog/index or blog/blog/post/1 i get a proper clean url without the duplicate blog in the url – blog/post/1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that most languages are becoming more and more like lisp, adopting
I have read many fine algorithms for identifying the most significant bit for 32-
I have read various posts in stackoverflow and I am trying to figure out
I have read few articles about table partioning but still I am bit confused
i.e. I have various URLs mapped using Spring MVC RequestMapping @RequestMapping(value = /mystuff, method
I am currently investigating a double request problem on my site. Not all the
I am not sure my question makes sense. I have read everything I could
I have read several interesting C#/F# comparisons here on stackoverflow. So, first of all,
most of the books about Project Management (if not all of them) describe management
All - I have read several posts here about svn repositories layout best practices

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.