AjaxHelper
Hi, I see that the AjaxHelper has been removed into project. Has been replaced by another helper or will be developed later ?
We don't have any immediate plans to support AjaxHelper in MVC 6, but we are certainly interested in customer feedback on the importance of supporting this in MVC 6. Putting this on our backlog for now.
Hi Danroh27, Don't understand why AJAX helper is not available ? this is very basic. do you have some alternative ? i am surprised by this ignorance of Microsoft team.
If this is not available then we have to go back to MVC 5.
Can you suggest any alternative way apart from J query ?
Hi rahuldhariya01, Actually, i write the ajax tags data-ajax-* directly without helper, finally it is ease and is still readable. The autocompletion support would be useful in the source editor.
Thanks Branciat. Even I tried the same but now success, failed ,onbegin,on completion event into this ?
An example of ajax action
<a href="@Url.RouteUrl("CoreApi", new { area = "Core", controller = "PostalAddress", action = actionName, id = Model })" class="hidden" data-ajax="true" data-ajax-mode="replace" data-ajax-failure="showError" data-ajax-update="#post_addr_form" id="pa_load_form"></a>
data-ajax="true" is required, data-ajax-mode can be to have a value as replace, before, after,... You use javascript function without parameter for each data-ajax-(failure, success, begin), it seems to me. Of course, added the jquery-ajax-unobtrusive script into the layout.
See the brad wilson's blog http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-ajax.html for a comparison AjxHelper and the html generated, also in complement the source code ajax unobtrusive.
Pulling back into the release based on customer feedback.
We are not going to get to this in this release.
jQuery ajax unobtrusive is open source and can be bower pulled.
As @branciat mentioned the data attributes for the call can be used.
+------------------------+-----------------------------+
| AjaxOptions | HTML attribute |
+------------------------+-----------------------------+
| Confirm | data-ajax-confirm |
| HttpMethod | data-ajax-method |
| InsertionMode | data-ajax-mode |
| LoadingElementDuration | data-ajax-loading-duration |
| LoadingElementId | data-ajax-loading |
| OnBegin | data-ajax-begin |
| OnComplete | data-ajax-complete |
| OnFailure | data-ajax-failure |
| OnSuccess | data-ajax-success |
| UpdateTargetId | data-ajax-update |
| Url | data-ajax-url |
+------------------------+-----------------------------+
- Please, add pushState to it when porting to ASP.NET Core 1.0. This was really strange to miss this feature in unobtrusive ajax script. Good example on this is how Turbolinks work in Rails.
- Also, I personally find it important to name it differently. "Unobtrusive" is fair enough, but it is not related neither to AJAX, nor to partials, links, pushState and so on. Again, Turbolinks sets the benchmark here.
The future is not AjaxHelper is the main method, but if the existing MVC4 project ported to aspnetCore, this is very necessary
The Ajax Helper will endup being the stumbling block when porting to Aspnet5 ore like now 😨
@danroth27 Any update on this ? Is this something still in the backlog or completely dropped ?
I think its totally possible for you to create your own AJAX extensions even if it is missing from ASP.NET Core. It seems that someone already did that, so all you need is to add it to your project and maybe modify it slightly if some code aint working: https://github.com/mono/aspnetwebstack/blob/master/src/System.Web.Mvc/Ajax/AjaxExtensions.cs
Closing because we have no plans to support this.