Beginners Learn MVC----MVC3.0 Error HTTP 404

Source: Internet
Author: User

MVC3.0 Framework Development project:

Error encountered while running the program: MVC 3.0 error HTTP 404 The resource You are looking for (or one of its dependencies) may have been removed, or

its the name has changed, or is temporarily unavailable. Please check the following URL and make sure it is spelled correctly.


Cause of the error: the route is incorrect.

Workaround: Open the project's "Global.asax" file, locate the route registration (RegisterRoutes ()) method, and change the controller in the route in it to an existing action. This is the same as when the program runs, the default to open the link, you can modify according to your own needs, do not show here.   

public static void RegisterRoutes (RouteCollection routes)        {            routes. Ignoreroute ("{resource}.axd/{*pathinfo}");            Routes. MapRoute (                "Default",//route name                "{controller}/{action}/{id}",//URL with parameter                new {controller = "Exam", action = "I Ndex ", id = urlparameter.optional}//parameter default value            );        }


Beginners Learn MVC----MVC3.0 Error HTTP 404

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.