Last post Jan 14, 2018 12:46 AM by Rivelyn
Jan 13, 2018 03:22 PM|Rivelyn|LINK
Worked a lot in my web form days with AJAX Update Panels. Decided I could use the same functionality in a current C# MVC 5 project I am working on.
I Did some searches and found mostly very old references to using AJAX update panels, like from 2009 up to 2012. Anyone have a link or some information on something more current, like from MVC 5, or at least 4.
Jan 13, 2018 07:21 PM|bruce (sqlwork.com)|LINK
its been years since I've used MVC's Ajax.BeginForm. It such a simple wrapper over jQuery's ajax, it just seems to make the client code harder to write, debug and read. The unobtrusive validation library has has updates since MVC 3 (mostly to support jQuery
and jQuery validation changes), but I think the unobtrusive ajax, is the same.
also, like many, I've switched to using a client client framework (angular, react, vue, etc) instead of $.ajax() and partials.
also if you are upgrading from webforms, you might find the client frameworks with ajax/webapi more similar to code than MVC.
Jan 13, 2018 07:51 PM|Rivelyn|LINK
No I am not upgrading, working on updating an application that has been in development/testing for a little over 2 years now developed using c# mvc 5. The new interface designs I am working on could benefit single panel updates over entire page postback.
I'll look into MVC Ajax.BeginForm, I never thought to look and see what is actually used in MVC, I just went straight to ajax update panel because that is what I was familiar with.
Jan 13, 2018 11:54 PM|bruce (sqlwork.com)|LINK
update panels were never added to MVC, and the Ajax.BeginForm was added in MVC 3, but has never had an update. Of course at this point MVC 5 is the last version, and has not had a update/patch for a couple years.
while asp.net core does not have direct support for the unobtrusive ajax script, you just add a reference to the script, and manually add the attributes to the form. see this example:
note: again I'd never use this with a new project.
Jan 14, 2018 12:46 AM|Rivelyn|LINK
I found a great article on he unobtrusive ajax script and the Ajax.BeginForm it perfectly suits our current requirement.
Thanks for your help!