nico maes

nico maes

  • NA
  • 4
  • 0

Javascript errors in ASP.NET MVC 5

Apr 23 2014 6:28 AM
Hello,
 
I'm trying to add modal popups to my MVC 5  solution and when I declare the javascript libraries and run my application I keep getting errors from javascript.
 
I'm not sure how to resolve this or if there is an other way to add a modal popup like CRUD popup on my page.
 
Here is what I've added to my _layout.cshtml.
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
</head>
 
And here is what I've added to the bundleconfig.cs:
bundles.Add(new StyleBundle("~/Content/themes").Include(
"~/Content/themes/base/jquery-ui.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.all.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.base.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.menu.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.spinner.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.theme.css",
"~/Content/themes/base/jquery.ui.tooltip.css"
));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"
));
 
I didn't add anything else yet, and still i'm getting the following errors:
0x800a138f - JavaScript runtime error: Unable to get property 'appendChild' of undefined or null reference
 
Unhandled exception at line 54, column 82 in http://pstatic.datafastguru.info/rss/min/fo.min.js?v=1386235399222&b=rightcoupon&l=right
0x800a139e - JavaScript runtime error: InvalidStateError
 
Any help on this matter would be appreciated.
 
Regards,