Customize View, Partial View And Layout Search Locations

ASP.NET stores all the views associated to a controller indie a sub-folder of Views folder by default. This is on the same line partial views and layout pages are stored inside Shared sub-folder under View folder. This default argument works fine; however, in most cases you may want to deviate from the conventional based arrangement and store views, partial views , and a different folder structure. Or in most cases, some application may want to store views outside views folder. In this case, methods like View() , Html.Partial() and PartialView() the system will not be able to find the needed .cshtml files.

You can deal with this situation by creating a custom view engine.

Read the rest of the tutorial here: http://www.binaryintellect.net/articles/066d2d81-6f86-47ff-93a3-bd0fad0ec44d.aspx

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
Email
Print