0

我想知道在 MVC(ie 3) + Razor 中,我们可以让局部视图具有与 iframe 相同的效果吗?例如右侧滚动条、固定高度等。

非常感谢!

4

1 回答 1

2

You can make use of CSS overflow, overflow-y and overflow-x properties to achieve the points you gave examples for (right side scroll bar, fixed height), making sure to include a height style or even width if required.

.partial-view-container
{
    height:400px;
    overflow:scroll;
}

The possible values for the overflow properties are

  • visible (default)
  • hidden
  • scroll
  • auto

So I guess your Razor markup would look something like this

<div class="partial-view-container">
@Html.Partial("InnerPartialView")
</div>

Further explanation at css tricks or w3schools

于 2012-11-07T05:05:39.090 回答