从视图中删除主布局 (MVC2)
如果我需要从我的视图中删除主布局,我该如何在 MVC2 中做到这一点? 我尝试将文档中显示的代码放入我的视图 http://sparkviewengine.com/documentation/master-布局:,但它仍然带来我的 Application.spark 布局:-/
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这个答案有点晚了(也许晚了很多),但您也可以使用 PartialView 方法。
相关 Spark 文档
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
未经测试,但如果您创建并清空主布局,并在视图顶部说
会怎样?或者您可以从控制器调用空主机;
return View("View", "EmptyMaster");
不知道它是否有效,但值得一试。
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.