4
我是新来的asp.net MVC4架构我被困在下面的东西请帮助我。如何在asp.net MVC4中包含javascript代码查看页面?
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
<script type="text/javascript">
$(function() {
$("#sections").tabs();
//here i am getting error that Object[object object] has not method tabs
});
</script>
<div id="sections">
<ul>
<li><a href="#section-1">section-1 </a></li>
<li><a href="#section-2">section-2 </a></li>
</ul>
<div id="section-1">
section-1 content............
</div>
<div id="section-2">
section-2 content............
</div>
</div>
在此先感谢......
感谢答复...但是当我删除@ Scripts.Render(“〜/ bundles/jqueryui”)这行说它没有定义$ – savy
你不应该删除'@ Scripts.Render(“〜/ bundles/jqueryui”)'行。如果'_Layout.cshtml'中已经存在'@ Scripts.Render(“〜/ bundles/jquery”)行,你应该删除它。是这样吗?我已经用我的答案更新了你的观点的外观。 –
非常感谢好友......我的问题解决了..... – savy