我有一个带有 razor 的 asp.net mvc4 应用程序。
View.Cshtml
<table>
<tr>
<th>
Concept technologique
</th>
<th></th>
</tr>
@foreach(Features_Management.Models.First_Attempt fa in Model)
{
<tr style="font-size: 12px; padding:0px;">
<td>
@Html.Raw(@fa.Concept)
</td>
<td>
@Html.ActionLink("Donner votre avis","", new { id_element = @fa.Id_element})
</td>
</tr>
}
</table>
当我点击 ActionLink
时,我需要在 Lightbox
中显示相同的 View 。
我该怎么做?有什么建议吗?
最佳答案
您可以使用FancyBox (灯箱的替代品)
将其添加到页面(.cshtml)
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery
/1.4/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" href="/css/jquery.fancybox-1.3.4.css" type="text/css"
media="screen" />
MVC 帮助程序代码
@Html.ActionLink("Donner votre avis","", new { id_element = @fa.Id_element,
@class='iframe'})
JS
$(document).ready(function() {
$('a.iframe).fancybox();
}
关于c# - 在 Razor 应用程序中将 View 显示为灯箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19543739/