简体   繁体   English

如何在Web页面网站中不使用_Layout页面

[英]How to NOT use the _Layout page in a Web Pages website

I have a webmatrix based website and have a test page. 我有一个基于webmatrix的网站,并有一个测试页面。 I need it to NOT be a part of the _SiteLayout page. 我需要它不是_SiteLayout页面的一部分。 How do I do this? 我该怎么做呢?

my dir: 我的主意:

root/
--assets/
--layouts/
----_SiteLayout.cshtml
--Default.cshtml
--Test.cshtml

As you can see above, there are two web pages in root dir, Default and Test. 如您所见,根目录中有两个网页,默认和测试。 Default uses the _SiteLayout page. 默认使用_SiteLayout页面。 So does Test. Test也是如此。 But I don't want Test.cshtml to use _SiteLayout page. 但我不希望Test.cshtml使用_SiteLayout页面。 Can this be done? 可以这样做吗?

Try set the Layout to null in the top of your Test.cshtml. 尝试在Test.cshtml的顶部将Layout设置为null。

@{
Layout = null;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM