Removing the main layout from a view (MVC2)

if I need to remove the master layout from my view, how can I do this in MVC2? I tried to put the code in my opinion, which was shown in the documentation http://sparkviewengine.com/documentation/master-layouts : but it still brings my Application.spark layout: - /

any ideas why?

+1
source share
2 answers

Not tested, but what if you create and clear a master layout and say <use master="EmptyMaster" /> at the top of your view? Or you can call an empty wizard from the controller; return View("View", "EmptyMaster");

I don't know if this will work, but it's worth it.

+1
source

I know this answer is a late litle (maybe a lot), but you can also use the PartialView method if you mean to make an HTML fragment instead of a full page.

Relevant spark documentation

  • Application.spark file in the Views / Layouts folder or in the Views / Shared folder

This is the most universal way to create a template for the entire site. It will not be used if the controller returns PartialView () .

+2
source

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


All Articles