Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 18, 2012 01:07 PM by gparvind
Member
2 Points
10 Posts
Sep 21, 2012 08:40 PM|LINK
JQuery UI button exception:
_Layout.cshtml:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>@ViewBag.Title - My ASP.NET MVC Application</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") @Scripts.Render(@Url.Content("~/js/jquery-1.8.0.min.js")) @Scripts.Render(@Url.Content("~/js/jquery-ui-1.8.23.custom.min.js")) @Styles.Render(@Url.Content("~/css/le-frog/jquery-ui-1.8.23.custom.css")) @Scripts.Render("~/js/JavaScript1.js") </head>
JavaScript1.js:
$(document).ready(function () { $("input:submit, a, button", ".demo").button(); $("a", ".demo").click(function () { return true; }); });
Exception:
Unhandled exception at line 2, column 5 in http://localhost:54316/js/JavaScript1.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'button'
Sep 21, 2012 08:50 PM|LINK
I found some offending code. It rendered older JQuery and jQuery UI files which caused the problem:
@Scripts.Render("~/bundles/jquery")
Deleting this line of code makes it work fine.
12 Points
1 Post
Nov 18, 2012 01:07 PM|LINK
try updating NuGet packages for jQuery and jQuery UI. The above line will then render with the latest jquery files.
Annwvyn
Member
2 Points
10 Posts
jQuery UI with ASP.NET MVC 4
Sep 21, 2012 08:40 PM|LINK
JQuery UI button exception:
_Layout.cshtml:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>@ViewBag.Title - My ASP.NET MVC Application</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") @Scripts.Render(@Url.Content("~/js/jquery-1.8.0.min.js")) @Scripts.Render(@Url.Content("~/js/jquery-ui-1.8.23.custom.min.js")) @Styles.Render(@Url.Content("~/css/le-frog/jquery-ui-1.8.23.custom.css")) @Scripts.Render("~/js/JavaScript1.js") </head>JavaScript1.js:
$(document).ready(function () { $("input:submit, a, button", ".demo").button(); $("a", ".demo").click(function () { return true; }); });Exception:
Unhandled exception at line 2, column 5 in http://localhost:54316/js/JavaScript1.js
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'button'
Annwvyn
Member
2 Points
10 Posts
Re: jQuery UI with ASP.NET MVC 4
Sep 21, 2012 08:50 PM|LINK
I found some offending code. It rendered older JQuery and jQuery UI files which caused the problem:
@Scripts.Render("~/bundles/jquery")Deleting this line of code makes it work fine.
gparvind
Member
12 Points
1 Post
Re: jQuery UI with ASP.NET MVC 4
Nov 18, 2012 01:07 PM|LINK
try updating NuGet packages for jQuery and jQuery UI. The above line will then render with the latest jquery files.