Removing master layout from view (MVC2)

后端 未结 2 1621
慢半拍i
慢半拍i 2021-01-24 02:14

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

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-24 02:42

    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().

提交回复
热议问题