Removing master layout from view (MVC2)
Asked Answered
M

2

1

if i need remove master layout from my view, how can i do it in MVC2? i tried put code in my view that was shown in documentation http://sparkviewengine.com/documentation/master-layouts: , but it still bring my Application.spark layout :-/

any ideas why?

Moxley answered 25/1, 2010 at 11:38 Comment(0)
M
1

Not tested, but what if you create and empty master layout, and say <use master="EmptyMaster" /> in the top of your view? Or you could call on the empty master from the controller; return View("View", "EmptyMaster");

Don't know if it'll work, but it's worth a shot.

Muscular answered 8/2, 2010 at 16:9 Comment(1)
that's what i did. p.s. don't really these small hacksMoxley
C
2

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

Relevant Spark documentation

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

This is the most general-purpose way to have a site-wide master template. It will not be used if the controller returns a PartialView().

Clove answered 26/3, 2010 at 0:2 Comment(0)
M
1

Not tested, but what if you create and empty master layout, and say <use master="EmptyMaster" /> in the top of your view? Or you could call on the empty master from the controller; return View("View", "EmptyMaster");

Don't know if it'll work, but it's worth a shot.

Muscular answered 8/2, 2010 at 16:9 Comment(1)
that's what i did. p.s. don't really these small hacksMoxley

© 2022 - 2024 — McMap. All rights reserved.