Tuesday, September 17, 2013

MVC Kendu UI - Script tag placement

MVC Kendu UI - Script tag placement

Can somebody please give me the exact way the scrips should be placed on
my layout page. no matter what way i do it I am getting diferent error or
some controls work and other dont or Im getting javascript errors.
My Layout page is like this:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<title>Clients To Profits @ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Styles.Render("~/Content/kendo")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title">@Html.ActionLink("your logo
here", "Index", "Home")</p>
</div>
<div class="float-right">
<section id="login">
@Html.Partial("_LoginPartial")
</section>
<nav>
<ul id="menu">
<li>@Html.ActionLink("User", "Index",
"UserView", new { area = "" }, null)</li>
<li>@Html.ActionLink("Home", "Index", "Home",
new { area = "" }, null)</li>
<li>@Html.ActionLink("API", "Index", "Help",
new { area = "" }, null)</li>
</ul>
</nav>
</div>
</div>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>&copy; @DateTime.Now.Year - Pauper To President,
Inc.</p>
</div>
</div>
</footer>
@*@Scripts.Render("~/bundles/jquery")*@
@RenderSection("scripts", required: false)
</body>
all scripts being registered at the top. but none of the comboboxes are
being rendered correctly, but the date picker is being rendered correctly.
when I register the jquery bundle at the end right before the closing body
tag, none of the controls render correctly, and i get all these js errors:
**Uncaught ReferenceError: jQuery is not defined kendo.all.min.js:12
Uncaught TypeError: Cannot read property 'jQuery' of undefined
kendo.aspnetmvc.min.js:11
Uncaught ReferenceError: $ is not defined Create:61
Uncaught ReferenceError: jQuery is not defined Create:106
Uncaught ReferenceError: jQuery is not defined Create:116**
The kenduUI version is at 1.9.1, but I am actually registering jquery
2.0.3. When I try to use 1.9.1 and register it at the bottom I get these
errors:
GET http://localhost:7731/Scripts/kendo/2013.2.716/jquery.min.map 404 (Not
Found)
I have spent 2 days trying to figure out what the problem is, can somebody
please help, who has figured this out already.

No comments:

Post a Comment