tri_inn

tri_inn

  • NA
  • 1.2k
  • 233.6k

ASP.Net MVC Core: setup view area location path

May 29 2017 6:58 AM
i read a article which discuss how to setup custom path for view
 
http://www.c-sharpcorner.com/article/expanding-razor-view-location-and-sub-areas-in-asp-net-core/ 
 
one area is not clear regarding routing code setup.
 app.UseMvc(routes =>      
  1.             {      
  2.                 routes.MapRoute(      
  3.                     name: "subAreaRoute",      
  4.                     template"{area:exists}/{subarea:exists}/{controller=Home}/{action=Index}/{id?}");      
  5.                 routes.MapRoute(      
  6.                     name: "areaRoute",      
  7.                     template"{area:exists}/{controller=Home}/{action=Index}/{id?}");      
  8.                 routes.MapRoute(      
  9.                     name: "default",      
  10.                     template"{controller=Home}/{action=Index}/{id?}");      
  11.     
  12.             });     
what is the meaning of {area:exists} code ?
what it does ? what it is checking ?
 
please help me to understand this. thanks

Answers (3)