c# - Home Index not loading when the application starts -
i working on asp.net mvc3 application.
in views created folder named home , view named index.
then created controller homecontroller.
in controller added:
public actionresult index() { return view(); }
but when run application error:
the resource cannot found. description: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review following url , make sure spelled correctly. requested url: /
if add address bar : /home/index view loads normally.
how can make application automatically go home/index when loads?
thanks help
you need add route global.asax file points path.
routes.maproute("default", "{controller}/{action}/{id}", new { controller = "home", action = "index", id = urlparameter.optional } );
Comments
Post a Comment