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

  • Home
  • SEARCH
  • 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 1045875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:03:16+00:00 2026-05-16T16:03:16+00:00

I have a hybrid asp.net web forms / mvc application that I recently converted

  • 0

I have a hybrid asp.net web forms / mvc application that I recently converted to .net 4 with mvc2. I have set-up that application to run on IIS 7.5 (on Windows 7) and the web forms part of the site is running okay but the MVC part is not. Whenever I try and access a page that needs to go through the routing engine I get

HTTP Error 404.0 – Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002

I’m debugging this web site through VS2010 (so I’ve set-it-up to use IIS instead of Cassini) and when I put a break point in the Application_Start function it is never hit so the routes are never registered. When I put a break point in the Page_Load function in one of the aspx page code-behinds it gets hit. So it seems that the problem is that the route is not being registered.

What am I missing?

  • 1 1 Answer
  • 1 View
  • 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-16T16:03:17+00:00Added an answer on May 16, 2026 at 4:03 pm

    From my experience with ASP.NET MVC, I’ve seen that a Default.aspx page is required for IIS to function correctly. I’m using the page that was included in the ASP.NET MVC 1 template. Unfortunately, the ASP.NET MVC 2 does not include this page (to the best of my knowledge), so you should add the following to your project:

    Default.aspx:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YourNamespace._Default" %>
    
    <%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
    

    Default.aspx.cs:

    using System.Web;
    using System.Web.Mvc;
    using System.Web.UI;
    
    namespace YourNamespace
    {
        public partial class _Default : Page
        {
            public void Page_Load(object sender, System.EventArgs e)
            {
                // Change the current path so that the Routing handler can correctly interpret
                // the request, then restore the original path so that the OutputCache module
                // can correctly process the response (if caching is enabled).
    
                string originalPath = Request.Path;
                HttpContext.Current.RewritePath(Request.ApplicationPath, false);
                IHttpHandler httpHandler = new MvcHttpHandler();
                httpHandler.ProcessRequest(HttpContext.Current);
                HttpContext.Current.RewritePath(originalPath, false);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.