日期:2014-05-17  浏览次数:20374 次

MVC里面布局你们具体怎么整,求帮
就是我要整个传统的三列居中布局,请问怎么设置模板页和CSS。。。求助

------解决方案--------------------
这个你了解一下MVC的Razor工作模式就可以了。网上一搜一大把。

其实layout-cshtml就相当于一个master page,你可以在这里定义你好你三层布局,只是把ContentPlaceHolder换成RenderSection就可以了。

<body>
<div id="wrap">
<div class="left">
@RenderSection("LeftColumn", false)
</div>
<div class="center">
@RenderSection("CenterColumn", false)
</div>
<div class="right">
@RenderSection("RightColumn", false)
</div>
</div>
</body>

在View页面中,你需要这样定义
@section LeftColumn{
<div>...</div>
}