Questions tagged [unobtrusive-ajax]

Question regarding Microsoft jQuery plugin for Unobtrusive Ajax

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

.Net Core Server Side Model Validation via unobtrusive ajax form

I have a View that uses unobtrusive ajax to submit a form or rather just normal jquery ajax would do the trick as well. For both implementations, I can get it to hit my controller fine and does my ...
0
votes
0answers
15 views

How do I capture an Ajax error in the data-ajax-failure function of my form in ASP.NET Core?

I want to capture my error message in the data-ajax-failure portion of my form which uses unobtrusive ajax. It's easy to do this if the form is posted via a function which calls $ajax but I'm not ...
0
votes
2answers
34 views

How do I serialize the unchecking of checkboxes?

I am trying to use unobtrusive-ajax to allow a site to update its contents as AJAX if JavaScript is available and as static pages if not. I'd like to support the browser's Back button moving backwards ...
0
votes
1answer
79 views

How to implement data-ajax-confirm with sweetalert using Unobtrusive Ajax?

Given the form ajax like this <form method="post" data-ajax="true" data-ajax-method="post" data-ajax-complete="completed" ...
2
votes
1answer
86 views

Stuck With Unobtrusive and Client Side validations

Hope everyone is doing great. I am using some unobtrusive jQuery in my razor pages .NET core 3.1, for form submission: <form asp-action="/Test" class="frm__action frm__validate" ...
0
votes
0answers
21 views

Ajax calls stop working while using MVC Custom routes

I have defined custom routes for user friendly URLs. But unable to call default route using ajax or on using Ajax.BeginForm() On removing custom routes, all works perfectly. This is my RouteConfig.cs ...
0
votes
0answers
30 views

AJAX Unobtrusive handling failure messages

I am using AJAX Unobtrusive on my .net core razor view as follows .. Inside my controller I have different if statements and in case of exceptions I want to return different custom error messages to ...
0
votes
0answers
121 views

dynamic form ajax beginform validation error - MVC

Implementation Detail: Page has Add Button and Table view On Add button click, partial view (form) is loaded on Modal PopUp. Dynamic form selected based on parameter. On Add button click below code ...
0
votes
0answers
77 views

.Net Core Unobtrusive Ajax OnSuccess

I've got a partial pop-up view lets call it AddContactView that adds contacts into a table, data-ajax-success will do some javascript to auto populate some fields in the main view with what I just ...
0
votes
2answers
124 views

Ajax button is raising this error:- The server has not found anything matching the requested URI (Uniform Resource Identifier)

I am working on an Asp.Net MVC core web application, and i have added the following form inside my razor view, to build an Ajax form:- <form method="get" data-ajax="true" data-ajax-url="/...
0
votes
0answers
20 views

using jquery validator unobtrusive how to validate one or two field of the form instead of whole form field

what I want to do is I want to validate the few fields of the form using validate unobtrusive on click of validating button but that is not happening but when I am validating using the whole form then ...
0
votes
1answer
55 views

Can you have 2 buttons in a form, when using Unobtrusive AJAX in Razor Pages?

I have 2 OnPost handlers in the PageModel for a form, is there a way to run Unobtrusive AJAX with different post handlers on each button? I can't seem to find anything on this. Or is there a better ...
2
votes
1answer
214 views

Using ValidateAntiForgeryToken attribute with Unobtrusive Ajax plugin in ASP.NET Core

I have the following form: <form asp-action="GetUsersAPICall" asp-controller="UsersObject" asp-antiforgery="true" data-ajax="true" data-ajax-method="get" data-ajax-mode="replace" data-ajax-update="...
1
vote
2answers
694 views

.Net Core 3.0 AJAX POST Body Always Null

I've recently converted my project from .Net Framework 4.7 to .Net Core 3.0. I'm having trouble getting my AJAX post to work. Here is what's working in .Net Framework 4.7: View: @using (Ajax....
0
votes
1answer
234 views

Ajax.BeginForm Post not able to bind a list of objects within a PartialView

I am attempting to set up a PartialView that displays a list of objects, which contain a boolean property that the end user will check off. Upon submitting, the PartialView should perform an AJAX POST ...
0
votes
1answer
94 views

Reinitialize unobstrusive jquery validation

I've rebinding viewmodel via ajax because of I don't like the default feature modal popup, since I forgot which tutorial link I'm following, here's some of my code The datatable code $(document)....
0
votes
1answer
241 views

How to make an Unobtrusive Ajax call within a Select List?

I am attempting to set up a drop down in my App that allows users to select a list of metadata depending upon whether or not it is classified as PII. The problem I am running into is how to ...
1
vote
1answer
369 views

Razor Pages ASP.NET unobtrusive ajax Post partial update

I'm trying to update only part of my page from a partial View. It works perfectly fine if i use this <a href="" data-ajax-met data-ajax="true" data-ajax-url="/Index?Handler=Partial" data-ajax-...
0
votes
1answer
262 views

JSON.parse error: unexpected character after project release

I used jquery.unobtrusive-ajax in my view. In this view, there is a form that is submit via ajax. In the action if the modelsets is invalid, I will return the errors through the code below Response....
1
vote
1answer
115 views

Is it possible to pass a parameter/single form element to a controller via unobtrusive AJAX in ASP.Net Core?

I've got a ASP.Net Core MVC app and I have the need to have certain elements update on a click. For example, a create a person form that searches for an existing address. I know that I can't use ...
1
vote
0answers
79 views

Clicking Ajax.ActionLink Produces a GET and a POST

Clicking a certain Ajax ActionLink in this app I just inherited produces a POST request AND a GET request (POST and then a GET immediately after). The first request hits the HttpPost method on the ...
1
vote
0answers
270 views

ASP.NET core (VS code) how to install Unobtrusive Ajax library

I am using Visual Code and would like to install Unobtrusive Ajax library. In Visual Studio, Unobtrusive Ajax library can be installed via Nuget. However, I cannot find a way to install Unobtrusive ...
0
votes
1answer
2k views

Does “jQuery Unobtrusive Ajax Helpers in ASP.NET Core” work in Asp.Net Core Razor Pages (New Web Framework from Microsoft)

A download is available in this link jQuery Unobtrusive Ajax Helpers in ASP.NET Core That I use in my "Asp.Net MVC Core 2.0" applications and eases my work. Is this library works in "Asp.Net Core 2....
2
votes
0answers
208 views

Unobtrusive Ajax lib Not sending XmlHttpRequest header

We're trying to implement a simple 'subscribe to our newsletter' form with the help of the aspnet Unobtrusive Ajax (js) library. We noticed (using Fiddler) that there is no XmlHttpRequest header ...
0
votes
0answers
818 views

Unobtrusive ajax validate server side

I was just trying out Unobtrusive ajax in .net core 2.0. I am trying the following model: public class Blog { public int BlogId { get; set; } [Required] [Never(ErrorMessage = "Never say ...
12
votes
5answers
12k views

How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project

I am trying to use Microsoft.JQuery.Unobtrusive.Ajax. I started by installing the package using NuGet and as expected I am able to see it among my dependencies. My problem is that I cant find a way ...
3
votes
2answers
9k views

data-ajax-update and data-ajax-mode=“replace” not working in dotnet core jquery unobtrusive ajax

I have an anchor which should replace a grid with a partial view . <a class="btn btn-primary" data-ajax="true" data-ajax-method="GET" ...
0
votes
1answer
51 views

Tags for modal are not being rendered

I am trying to fill in a modal template using javascript and partial views. I have my template in my master layout file and I want it filled when an Ajax ActionLink is clicked. However 4 inner divs in ...
1
vote
1answer
291 views

Stop previous unobtrusive ajax call

I have a form like : @using (Ajax.BeginForm("List", null, new AjaxOptions() { UpdateTargetId = "results" }, new { id = "myform" })) { <input id="search" type="text" value="" /> } I ...
0
votes
1answer
826 views

Asp.net core cloudflare ssl Blocked Mixed content using unobtrusive-ajax

I have recently set up a website that uses cloudflare free ssl. When using ajax calls for pagination I get a mixed content error, I assume because it's still at some point transmitted over http!? I ...
0
votes
1answer
750 views

Ajax.BeginForm change AjaxOptions depending on submit value

How can I change the values ​​of the AjaxOptions depending on the submit value of the pressed button. In View: @using (Ajax.BeginForm("function_name", "Controller", new AjaxOptions { HttpMethod =...
10
votes
2answers
13k views

ASP.NET Core and JQuery unobtrusive AJAX not working

If I start a new project in .net 4.5 and hit manage nuget packages, search for ajax, then hit install for ajax unobtrusive. I can then go into my cshtml file and type @Ajax.___ e.g. @Ajax.beginForm ...
-1
votes
1answer
922 views

pass javascript object ajax beginform mvc

Hi all I don't know is this possible or not ,that's why guys I need suggestion to achieve this .The thing is I want to post javacript object with ajax-beginform instead of model object to controller ....
2
votes
0answers
3k views

Getting a 415 Unsupported Media Type error when posting an ASP.NET Core MVC form with unobtrusive ajax

I am creating an ASP.NET MVC Core web application. I have a form in my View that posts to the Create action in the ProductsController. I am using jquery unobtrusive ajax so my form looks like the ...
1
vote
0answers
2k views

Returning BadRequest in ASP.Net Core MVC to Microsoft jQuery Unobtrusive Ajax post has ModelState undefined

THE PROBLEM I am trying to return service side validation errors from ModelState using BadRequest(ModelState) but when I try to assign the the jQuery ModelState from xhr.responseText I am getting ...
0
votes
1answer
232 views

Why should I add jquery scripts with ms unobtrusive Ajax?

I have followed several tutorials about microsoft unobtrusive Ajax Nuget package. They say I should add this script inclusion in my main layout: <script src="~/Scripts/jquery.unobtrusive-ajax.js"&...
1
vote
1answer
910 views

Conflict between unobtrusive-ajax and jQuery

I have an MVC4 project where I've used NuGet to install jQuery 3.1.0 and Microsoft.jQuery.Unobtrusive.Ajax 3.2.3. My bundle is this: bundles.Add(new ScriptBundle("~/bundles/scripts").Include( ...
3
votes
1answer
791 views

Jquery-Unobtrusive-Ajax Not Finding data-ajax-update

I have the following link in my MVC Core project: <a asp-action="ArtictleDetailsById" asp-controller="Home" asp-route-area="Global" asp-route-id="@Model.Id" data-ajax="true" data-ajax-...
1
vote
0answers
2k views

MVC C# PagedList - PagedListPager passing parameters

I have a paged list using unobtrusive ajax that looks like this. @Html.PagedListPager(Model, page => Url.Action("Images", "Admin", new { imageLibrary = image.ImageLibrary, page }), ...
1
vote
0answers
803 views

ASP.NET MVC Ajax.BeginForm file upload not being unobtrusive

I have the following in my View <div name="image-upload-section" class="control-label"> @using (Ajax.BeginForm("UploadAdditionalImage", "Image", "UploadAdditionalImage", ajaxOptions, new { ...
1
vote
1answer
279 views

How to extend Microsoft jQuery Unobtrusive Ajax without changing jquery.unobtrusive-ajax.js file?

jquery.unobtrusive-ajax.js looks like the following: I would like to add the following event to the library so that I can use asyncRequest() function but in a different file. $(document).on("change",...
2
votes
2answers
1k views

Rendering a partial View with Ajax Unobtrusive

I have the following View and Partial View. In the index action method I need the Create to rendered as a Partial View. Based on the answer in this question I tried using Ajax helper methods(I find ...
0
votes
2answers
806 views

How to remove DOM element after ajax request with unobtrusive-ajax?

In the callback function "OnSuccess",i can't get the element which i've clicked. After click the "Del" button ,i try to remove the "tr" element which one the "Del" button in that i just clicked.how to ...
1
vote
1answer
590 views

AJAX Form redirects instead of updating target

I know this question has been asked a lot and I have tried every solution I can find but I still cannot get my Ajax form to update the DIV rather then redirecting to the Action Method e.g(Local..Home/...
0
votes
1answer
103 views

Can we stop sending ajax for a while and continue?

I need to stop sending ajax request of an Ajax.ActionLink for a while on OnBegin and continue the request if confirm alert is true. In below code i could abort ajax request, is there any way to resend ...
1
vote
1answer
1k views

Calling javascript function on OnSuccess callback of Ajax.actionlink?

I am using MVC5. I am loading images from a list using Unobtrusive Ajax.ActionLink(). Here is the sample code:- <ul class="list-group list-unstyled lists"> @foreach (var item in Model) { <li&...
0
votes
1answer
21 views

MVC4 javascript file location

I am trying to create MVC4 application. The scaffolded scripts contained older jquery so I updated it to 1.10 but corresponding mvc4 file unobtrusive-ajax.js seems to stop working as it is using live(...
1
vote
0answers
576 views

MVC unobtrusive ajax: send textbox value as query string with ajax action-link GET request

In the sample code below, I have ajax action-link sending out a GET request. I want to send the value of Message text-box as query string for the request. I know this can be done with ajax-forms. But ...
1
vote
1answer
2k views

MVC Ajax ActionLink replaces the entire bootstrap modal-body

The Ajax.ActionLink below has an empty AjaxOptions. Surprisingly it automagically renders the ajax response into the modal and replaces the entire .modal-body element. My intention is to render the ...
2
votes
1answer
789 views

MVC Multiple Ajax Calls

I am having trouble making ajax calls in my MVC application. I have tried two different ways to be able to have an ajax actionlink load a partial and then that partial submit a form as an ajax call, ...