如何在mvc5中添加模板布局 [英] how to add template layout in mvc5
本文介绍了如何在mvc5中添加模板布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在mvc5中添加模板布局,我想在我的项目中添加自己的模板
所以我想要一步一步的代码我可以遵循?
how to add template layout in mvc5, I want to add my own template on my project
so I want the step by step code that I can follow?
推荐答案
从这个链接下载源代码
ASP.NET MVC 5 - 3步骤Bootstrap 3.0 [ ^ ]
download the source from this link
ASP.NET MVC 5 - Bootstrap 3.0 in 3 Steps[^]
步骤1:将css布局拖到项目中
确保css布局中的每个引用文件都在你拖入项目的文件夹中
step2:更改html文件扩展名从html到cshtml。
例如index.html到index.cshtml
step3:打开html文件,选择第一行的文件,参考webview页面@inherits System.Web.Mvc.WebViewPage在cshtml文件上br />
step4:渲染体 - 在< body>之间的任何地方< /体>你必须渲染用作@Renderbody的html体()
请按照上述步骤
step 1 :Drag the css layout to the project
make sure that every referenced file in the css layout is inside the folder you are dragging into the project
step2: change the html file extension from html to cshtml.
e.g index.html to index.cshtml
step3: open the html file, select the first line of the file, reference webview page @inherits System.Web.Mvc.WebViewPage on the cshtml file.
step4: Rendering body - anywhere between <body> </body> you have to render the html body used as @Renderbody()
Please follow steps above
这篇关于如何在mvc5中添加模板布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文