How to set the default start page to the "Region" action

I have a project structure (see below). When I run the project, I get this error (see below). Could you tell me about the changes that I need to make, I would like to go to MyAreas1 \ Home when starting the project

Thanks,

Error message: The index view or its wizard was not found or the viewer does not support the locations found. The following locations were searched:

~/Views/Home/Index.aspx ~/Views/Home/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Home/Index.cshtml ~/Views/Home/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml 

enter image description here

+6
source share
3 answers

You must set the specified routing in the Global.asax file

 routes.MapRoute( "Default", // Route name "MyArea1/{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults 

So, you need to edit your default route.

+3
source

Try right-clicking on the project properties → → Web → now check the “Defined page” box and enter the control_name / username

+1
source

routes.MapRoute ("Area", ", new {area =" AreaName ", controller =" ControllerName ", action =" ActionName "});

0
source

Source: https://habr.com/ru/post/904536/


All Articles