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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -