Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Home/Index.aspx
Posted
Updated 19-Dec-14 22:52pm
v2

In MVC you no need to specify the .aspx or cshtml extension
Simply put like below
/Home/Index

Hope this helps
 
Share this answer
 
your URL should be meaningful

C#
/ControllerName/ActionName

/Home/Index

Home -> ControllerName
Index -> ActionName with in that Controller
 
Share this answer
 
You should understand the routing in MVC. This is a simple issue.
Since you are using MVC, this deals with controller and Actions inside.
That is when the request is send, mvc router by default expects a controller and an action with parameters if any.
You can check the above statement inside the App_Start->Routeconfig.cs
C#
public static void RegisterRoutes(RouteCollection routes)
       {
           routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

           routes.MapRoute(
               name: "Default",
               url: "{controller}/{action}/{id}",
               defaults: new {controller = "Home", action = "Index", id = UrlParameter.Optional }
           );
       }


This is how the route looks. So when you type Index.aspx/Index.cshtml(if Razor), then it will throw 404 not found error as no such Action exists inside Home controller with Index.aspx name.
I hope this clears your query.
thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900