有人可以幫我這個ActionLink的我想開一個隱藏的DIV在剃刀,剃刀ActionLink的開彩盒
這是鏈接,
<a class='inline' href="#inline_content">Inline HTML</a>
這是腳本,
<script>
$(document).ready(function() {
$(".inline").colorbox({ inline: true, width: "50%" });
});
</script>
而且也是事業部,
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
<p><strong>This content comes from a hidden element on this page.</strong></p>
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
</div>
</div>
編輯
我需要在MVC Razor風格的ActionLink中重寫HTML鏈接,代碼可以在HTML中正常工作,但不在Razor中。 HTML鏈接發佈到Razor的新頁面,所以我想我需要一個ActionLink來發布到腳本。
<a class='inline' href="#inline_content">Inline HTML</a>
e.g ..
@Html.ActionLink("Inline HTML", null, null, new { Class="inline", onclick = "#inline_content();" });
http://stackoverflow.com/questions/1974980/putting-html-inside-html-actionlink-plus-no-link-text – rjdmello