Why action in controller return view() can direct to other view with same name?
My project called nopCommerce, which is open source.
I download it and start to develop.
When I visit index, run into Index() in HomeController.cs.
public partial class HomeController : BasePublicController { public virtual IActionResult Index() { return View(); } }
return view(), direct to the same view named \Views\Home\Index.cshtml
I can understand it.
This project can plug theme, I plug a theme by copying its code to \Themes\Views\
When I visit this index after plugged, It returns view() directly to \Themes\Views\Home\Index.cshtml
I can not understand it.
Why the action in controller return view() can direct to other view with same name?
I try to renamed \Themes\Views\Home\Index.cshtml
It direct to \Views\Home\Index.cshtml
Obviously you got to do certain changes in RouteConfig.cs or using [ActionName("")]
I found it,the project will set ViewLocationExpanderContext by theme name