unobtrusive-ajax

Upload is null after adding jquery.unobtrusive-ajax.js reference

牧云@^-^@ 提交于 2019-11-30 09:16:20
问题 If I don't refer jquery.unobtrusive-ajax.js I can get attachment on Post. If I refer it It's giving me null. <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script> @using (Ajax.BeginForm("Index", "ContactSubmission", new AjaxOptions{ InsertionMode = InsertionMode.Replace, HttpMethod = "POST", OnSuccess = "updateSuccess" }, new { enctype = "multipart/form-data",@class = "form-horizontal", role = "form" })) { ///code here } [HttpPost] public JsonResult Index(Contact contact) { if

Upload is null after adding jquery.unobtrusive-ajax.js reference

久未见 提交于 2019-11-29 13:59:29
If I don't refer jquery.unobtrusive-ajax.js I can get attachment on Post. If I refer it It's giving me null. <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script> @using (Ajax.BeginForm("Index", "ContactSubmission", new AjaxOptions{ InsertionMode = InsertionMode.Replace, HttpMethod = "POST", OnSuccess = "updateSuccess" }, new { enctype = "multipart/form-data",@class = "form-horizontal", role = "form" })) { ///code here } [HttpPost] public JsonResult Index(Contact contact) { if (ModelState.IsValid) { if (contact != null) { string attachment = string.Empty; // HttpPostedFileBase

ASP.NET MVC 3 and jquery.unobtrusive-ajax.min.js

一曲冷凌霜 提交于 2019-11-29 10:46:56
I want to use the Ajax.ActionLink Html helper therefore I need the jquery.unobtrusive-ajax.min.js library but IE is always showing this error: Microsoft JScript runtime error: Unable to set value of the property 'unobtrusive': object is null or undefined I've read that the solution is usage of jquery.validate.min.js and jquery.validate.unobtrusive.min.js but then I can't recognise the ajax call on server side. I've read that the solution is usage of jquery.validate.min.js and jquery.validate.unobtrusive.min.js No, those 2 script have nothing to do with jquery.unobtrusive-ajax.min.js . They are

ASP.NET MVC 3 and jquery.unobtrusive-ajax.min.js

空扰寡人 提交于 2019-11-28 03:50:47
问题 I want to use the Ajax.ActionLink Html helper therefore I need the jquery.unobtrusive-ajax.min.js library but IE is always showing this error: Microsoft JScript runtime error: Unable to set value of the property 'unobtrusive': object is null or undefined I've read that the solution is usage of jquery.validate.min.js and jquery.validate.unobtrusive.min.js but then I can't recognise the ajax call on server side. 回答1: I've read that the solution is usage of jquery.validate.min.js and jquery

jQuery unobtrusive validation ignores “cancel” class on submit button if used in Ajax form

一世执手 提交于 2019-11-28 00:12:12
I am trying to implement optional client side validation using ASP.NET MVC 4, unobtrusive jQuery validation, unobtrusive ajax This works fine Following pictures show what I mean with optional client side validation: The only one field on my form is expected to contain email, so there is an email validator attached to it. Now we click on save. Because our text "name@doamin" is not a valid email the validation summary gets displayed. Together with validation summary we are unhiding "Save anyway" button. This second button is a normal submit button just having class="cancel" . This instructs

jquery.unobtrusive-ajax plugin broken when updating to Jquery 1.9.0 [duplicate]

天大地大妈咪最大 提交于 2019-11-27 16:00:47
Possible Duplicate: jQuery 1.7 - Turning live() into on() //Solution: I simply replaced the four occurrences like the approved answer suggested and unobtrusive ajax plugin is up and working again with jquery 1.9.0 Update//Observe the comments for the answer marked at the bottom which is the best way to solve this. //Original post: I upgraded to jQuery 1.9.0 but then unobtrusive ajax plugin went down since they deprecated the live method. I tried to replace it like this since the upgrade fixes an other bug for me. However, it does not work. I simply replaced live with on like this: $("a[data

How to use $(this) inside MVC3 Ajax.ActionLink OnBegin,OnComplete Events

纵然是瞬间 提交于 2019-11-27 05:59:59
问题 My Controller creates a list of links like this <ul id="MainMenu"> @foreach (var item in Model.MenuItems) { <li>@Ajax.ActionLink(item.Caption, item.ActionName, item.ControllerName, new AjaxOptions { UpdateTargetId = "pageBody", OnBegin = "BeginUpdatePage", OnComplete = "EndUpdatePage", OnFailure = "FailUpdatePage" }) </li> } </ul> I have some javascript like this function BeginUpdatePage() { $("#MainMenu li").removeClass('selected'); $(this).parent().addClass('selected'); $("#pageBody")

jQuery unobtrusive validation ignores “cancel” class on submit button if used in Ajax form

时光毁灭记忆、已成空白 提交于 2019-11-26 23:16:49
问题 I am trying to implement optional client side validation using ASP.NET MVC 4, unobtrusive jQuery validation, unobtrusive ajax This works fine Following pictures show what I mean with optional client side validation: The only one field on my form is expected to contain email, so there is an email validator attached to it. Now we click on save. Because our text "name@doamin" is not a valid email the validation summary gets displayed. Together with validation summary we are unhiding "Save anyway

Unobtrusive Ajax stopped working after update jQuery to 1.9.0

旧街凉风 提交于 2019-11-26 22:22:54
I have just updated jQuery & jQuery UI to: jquery-1.9.0.min.js and jquery-ui-1.9.2.min.js And... all my unobtrusive Ajax calls (Ajax.ActionLink, Ajax.BeginForm) stopped working properly - they open results in a new page instead of updating the existing div. And I get this javascript error in Firebug when my page loads: Code hasn't changed of course, just updated the jQuery scripts using Nuget. Anyone experienced the same problem ?? .live() has been deprecated since 1.7 and was officially removed in jQuery 1.9 . Use .on() instead as it is the preferred method of doing the same thing . jason_ruz

jquery.unobtrusive-ajax plugin broken when updating to Jquery 1.9.0 [duplicate]

冷暖自知 提交于 2019-11-26 17:23:23
问题 Possible Duplicate: jQuery 1.7 - Turning live() into on() //Solution: I simply replaced the four occurrences like the approved answer suggested and unobtrusive ajax plugin is up and working again with jquery 1.9.0 Update//Observe the comments for the answer marked at the bottom which is the best way to solve this. //Original post: I upgraded to jQuery 1.9.0 but then unobtrusive ajax plugin went down since they deprecated the live method. I tried to replace it like this since the upgrade fixes