Reputation: 5750
Using ServiceStack.Razor and having a slight issue.
I have a default _Layout.cshtml
page that is my base layout, but for some pages, I don't want a layout, I just want to a full html page with no templating, similar to how setting the Layout to null in ASP.NET MVC would work.
I cannot figure out how to do this, and can't find anything in the documentation (not saying it's not there, just can't find it).
Things I've tried:
Setting the Layout property to null on the actual view page:
@{
Layout = null;
}
Returning a null template from the actual service:
return HttpResult(dto) { Template = null; };
Moving my view page out of the Views folder (this just took it back to the default ServiceStack view page)
Any help greatly appreciated.
Thanks, and sorry if I missed something simple
Upvotes: 2
Views: 287
Reputation: 143389
Layout=null
indicates no Layout was specified, so will use the default _Layout.cshtml
.
You can use an empty string ""
for no Layout, e.g:
@{
Layout = "";
}
Otherwise if preferred, create an "Empty"
layout e.g: /Views/Shared/Empty.cshtml
containing just:
@RenderBody()
Upvotes: 1