Я хочу использовать JQueryUI с моим приложением MVC4, но я не вижу эффекта, который я хочу. Я покажу вам код, я думаю, что это ошибка начинающего. Я должен был забыть о директиве.Я не могу использовать JQueryUI с ASP.NET MVC4
_Layout.cshtml (Just декларация)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>@ViewBag.Title - Mon application ASP.NET MVC</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@RenderSection("JavaScript", required: false)
@Styles.Render("~/Content/css")
myView.cshtml
@section JavaScript
{
<script type="text/javascript">
$(function() {
$("#dialog").dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
}
});
$("#opener").click(function() {
$("#dialog").dialog("open");
});
});
</script>
}
@{
ViewBag.Title = "Home Page";
}
@{
if (!Session.IsNewSession && Session.Contents["connecte"].Equals(true))
{
<div id="dialog" title="Basic dialog">
<p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
<button id="opener">Open Dialog</button>
}
else
{
<div class="group_bannner_right">
<img src="~/Images/picture.png" width="550" height="316" alt="baner">
</div>
<header class="group_bannner_left">
<hgroup>
<h1>Simple.Think. </h1>
<h2>
“The little things are infinitely the most important.“
</h2>
</hgroup>
</header>
}
}
У меня есть эта ошибка:
Uncaught TypeError: Object [object Object] has no method 'dialog'
(index):18 (anonymous function)
(index):18 fire
jquery-1.8.2.js:988 self.fireWith
jquery-1.8.2.js:1096 jQuery.extend.ready
jquery-1.8.2.js:420 DOMContentLoaded
Выглядит хорошо для меня, вы создали после того, как вы отредактировали файл Bundler ?, и/или проверьте, что/если какие-либо ошибки консоли. –
Я не редактировал файл Bundler. –
Я просто хочу это сделать [JQueryUI] (http://jqueryui.com/dialog/#animated) –