Reputation: 67
I changed the name of view files (Index.cshtml -> Performance.cshtml), and when I execute the project, the application can't recognise the new view name. I changed the name of an action in controller accordingly (ActionResult Index() -> ActionResult Performance()). However, it keeps saying HTTP 404 error.
Upvotes: 0
Views: 2571
Reputation: 203
When you change your view name mvc application can't find a proper view for it's controller action method.
If it is your default page view( load on application start) than you also need to make changes in your Route_config file.
See the image below Change controller = " Name_of_controller"
& action="name_of_action"
in your case action name will be Performance.
Always Remember in mvc you can run any method using browser url
for example : controller is home & method is Performance than url will be localhost:port/home/Performance
Upvotes: 1
Reputation: 312
Change the default route defined in App_Start/RouteConfig.cs file to set Performance as the default action.
Or, you can run the project with the following URL:http://localhost:port/home/Performance
Upvotes: 1