PartialView is not posting back to the updateTarget. Posts back a complete page

I had a PartialView that is using the Ajax form. When the form submits, the action in the controller should update the div with the id that matches the UpdateTargetId. Instead the entire page loads with the partial view. Or if I return javascript, the javascript command is printed as text on the page rather than executing.

This has to do with the JQuery not being correct and I have read several things about this being because the live() function is not in the version of JQuery that you are using. I had been referring to a CDN for the JQuery, so I decided to refer to local JQuery and then it started working.

I removed:

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />

<script src="http://cdn.kendostatic.com/2013.2.918/js/jquery.min.js"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>

<script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js"></script>

<script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.all.min.js"></script>

<script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.aspnetmvc.min.js"></script>

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">

<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>

I updated it as follows:

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />

<link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />

<script src="~/Scripts/jquery-1.9.1.js"></script>

<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>

<script src="~/Scripts/jquery.validate.js"></script>

<script src="~/Scripts/jquery-ui-1.9.2.js"></script>

<script src="~/Scripts/modernizr-2.6.2.js"></script>

<script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.all.min.js"></script>

<script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.aspnetmvc.min.js"></script>

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">

<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>

Update:
The problem was in http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js. That file tries to call .live() which is deprecated and has been replaced by .on(). The local /jquery.unobtrusive-ajax.min.js file I’m using calls .on() and therefore works properly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s