Dialog Jquery not working

2

index.cshtml code

<link href="~/Content/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/jquery-1.10.2.js" type="text/javascript"></script>
<script src="~/Scripts/jquery-ui.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#finestra").dialog({ autoOpen: false });
    });
</script>

<div>
    <p>
        JQuery Dialog Test
    </p>
    <div id="finestra" title="Test">
        <div>content</div>
    </div>
</div>

I am getting a 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'dialog' error. I have added a jquery 1.11.4 reference. I checked other similiar questions but could not find a problem it is causing.

jquery
asp.net-mvc
razor
asked on Stack Overflow Jul 8, 2015 by Himani • edited Jul 8, 2015 by shilovk

1 Answer

1
 public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        //"~/Scripts/jquery-{version}.js",
                        "~/Scripts/jquery-ui.js"));
        } 

I commented "~/Scripts/jquery-{version}.js" so the code didnot refer the older jquery and it worked.

answered on Stack Overflow Jul 8, 2015 by Himani

User contributions licensed under CC BY-SA 3.0