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 7910067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:43:03+00:00 2026-06-03T12:43:03+00:00

I have an ASP.NET Web Forms APP, I want to migrate it to ASP.NET

  • 0

I have an ASP.NET Web Forms APP, I want to migrate it to ASP.NET MVC a piece at a time. I have setup MVC to run within the webforms app. I have everything set up appropriately such that if I put my ASP.NET MVC folders (Controllers, Views) in a subfolder called MVC in the project, and set my routes in my global asax to

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
    routes.MapRoute("Default", // Route name
        "w/{controller}/{action}/{id}", // URL with parameters
        new { controller = "Home", action = "Index", id = "" } // Parameter defaults
    );
}

protected void Application_Start()
{
    RegisterRoutes(RouteTable.Routes);
}

All of the config and assembly references are setup. If I debug I can hit a breakpoint that is inside my Index method, on my Home controller.

public class HomeController
    : Controller
{
    public ActionResult Index()
    {
        this.HttpContext.Trace.Write("Hrm...");
        return View("index", (object)"Hello");
    }
}

The problem that is occurring is that

return View("index", (object)"Hello");

Does not return an error status code or the search list you’d expect typically if MVC can’t locate the view. Instead I am getting a 200 http response, and nothing in the content body of the response.

Here are the http request details:

GET http://localhost.:2396/w/home/index2 HTTP/1.1
Accept: */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; InfoPath.2; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: localhost.:2396
Pragma: no-cache
Cookie: ASP.NET_SessionId=3yqf2t55sckemhmxq2bhibmq

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Wed, 09 May 2012 12:42:43 GMT
X-AspNetMvc-Version: 2.0
Cache-Control: private
Content-Length: 0
Connection: Close

That request above goes to index2, which is an action that doesn’t exist and it doesn’t give me an error. I suspect the ViewResult in the index action is throwing an exception but somehow it’s getting supressed somewhere. I inherited this code base, so I’m just trying to figure out whats going on.

In the web.config i’ve configured the error handling such that i should be able to see any errors messages, but that still doesn’t explain why the http status code is always 200.

<customErrors mode="Off"/>

<httpErrors errorMode="DetailedLocalOnly"/>

Another quick note, is if i replace

return View("index", (object)"Hello");

with

return Content("abc");

It will correctly output “abc” in the content body of the http response.

Any ideas?

  • 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-06-03T12:43:06+00:00Added an answer on June 3, 2026 at 12:43 pm

    Seems like your view is in wrong location because you mentioned that Controller, Views are under a folder called “MVC”.

    The “Views” folder should be under the root directory, that is the place where ViewEngine looks for the views.

    Update:
    You can override this default behavior using a custom ViewEngine. For that implement IViewEngine interface and it has got a method called FindView where you can implement your own logic to scan different location.

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

Sidebar

Related Questions

I have a asp.net web forms app that uses System.Web.Caching.Cache to cache xml data
I have an ASP.NET 4 Web Forms app that is using URL Routing. I
I have a simple web app built in asp.net webforms c# where and how
To learn ASP.net I started building a todo web app(web forms not MVC), this
I have developed a web app in ASP.NET MVC which we are using internally.
I have an ASP.NET web forms app with a button on it. This button
I have 2 web application projects. One is my asp.net MVC app and the
I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an
I have to integrate an existing, simple asp.net web forms app including postbacks etc.
Background I have a page on my ASP.NET MVC web app for users to

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.