Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 3 - Ajax.BeginForm vs jQuery Form Plugin

I'm starting a new ASP.NET MVC 3 project and am going to implement some screens that are read only by default but allow the user to edit information by clicking on an Edit button. I want these screens to be AJAXed. I have previously used the jQuery Form Plugin to implement similar screens on an ASP.NET MVC 2 project.

I've just discovered the existence of Ajax.BeginForm() and was wondering whether I should use that since it is built in, instead of using the jQuery Form Plugin. I've done a Google search on the difference between the two techniques but couldn't find anything.

What I would like to know is which one (or a different one altogether) should I use with ASP.NET MVC 3.

What are the best practices and libraries for implementing AJAX forms in ASP.NET MVC?

What are the strengths and weaknesses of Ajax.BeginForm vs the jQuery Form Plugin?

like image 795
John Mills Avatar asked Feb 06 '11 05:02

John Mills


1 Answers

If you're going to use Ajax.BeginForm, I would suggest turning on UnobtrusiveJavaScript. One upside of using the built in mvc helpers is that it's one less library you need to include. Otherwise an upside of the jQuery.Form plugin I could see is more control of your event handling. As you don't have to worry about the MVC ajax form firing before you have a chance to do something.

like image 120
Vadim Avatar answered Sep 20 '22 11:09

Vadim