34
votes
1answer
14k views

ASP.NET MVC 2 - Failed with jquery ajax response

I do not understand this error, do not generate error in "JsonResult Test ()", I am doing other projects as ASP.NET MVC Thanks Error: System.InvalidOperationException: This request has been blocked ...
33
votes
4answers
48k views

How to use getJSON, sending data with post method?

I am using above method & it works well with one parameter in url e.g. Students/getstud/1 where controller/action/parameter format is applied. now I have an action in Students controller that ...
26
votes
3answers
11k views

Pass array to mvc Action via AJAX

I'm trying to pass an array (or IEnumerable) of ints from via AJAX to an MVC action and I need a little help. the javascript is $.get('/controller/MyAction', { vals: arrayOfValues }, function ...
26
votes
3answers
15k views

ASP.NET MVC Ajax Error handling

How do I handle exceptions thrown in a controller when jquery ajax calls an action? For example, I would like a global javascript code that gets executed on any kind of server exception during an ...
25
votes
2answers
17k views

jQuery Ajax POSTing array to ASP.NET MVC Controller

I'm missing something here. I've got this jQuery JavaScript: $.ajax({ type: "POST", url: "/update-note-order", dataType: "json", data: { orderedIds: orderedIds, ...
25
votes
5answers
12k views

Handling session timeout in ajax calls

I'm making an ajax call using jquery to an asp.net mvc controller action: [AcceptVerbs(HttpVerbs.Post)] public ActionResult GetWeek(string startDay) { var daysOfWeek = ...
24
votes
5answers
21k views

How to make update panel in ASP.NET MVC

Hi Guys i make search about how to make update panel in MVC ,but , because it is new , i cannot find good samples regarding it.How can i implement this to MVC? Thanks
22
votes
1answer
19k views

$.ajax( { async : false } ) request is still firing asynchronously?

I got a little problem here guys. I'm trying to implement the following scenario: 1- A user opens the home page and sees a list of other users and clicks to add one to his friend list. 2- I issue an ...
20
votes
7answers
45k views

How to post ASP.NET MVC Ajax form using JavaScript rather than submit button

I have a simple form created using Ajax.BeginForm: <% using (Ajax.BeginForm("Update", "Description", new { id = Model.Id }, new AjaxOptions { UpdateTargetId = "DescriptionDiv", ...
16
votes
4answers
24k views

How to send a model in jQuery $.ajax() post request to MVC controller method

In doing an auto-refresh using the following code, I assumed that when I do a post, the model will automatically sent to the controller: $.ajax({ url: '<%=Url.Action("ModelPage")%>', ...
13
votes
6answers
20k views

Difference Between $.getJSON() and $.ajax() in jQuery

I am calling an ASP.NET MVC action public JsonResult GetPatient(string patientID) { ... from JavaScript using jQuery. The following call works $.getJSON( '/Services/GetPatient', { patientID: "1" ...
12
votes
6answers
8k views

jQuery post causes Uncaught SyntaxError: Unexpected token :

I found a bunch of similar questions here but after 3 hours of reading them and trying stuff, I am posting my own. I apologize for the duplication, but I just don't know what's going on here. So I ...
12
votes
11answers
529 views

Apart from UI “flair”, what do you use jQuery for?

From an ASP.NET MVC perspective, what do you use jQuery for? Apart from UI "flair" - things like fading colours and pretty animations. Things I can immediately think of include pop-up calendars and ...
11
votes
3answers
12k views

Send list/array as parameter with jQuery getJson

I have the following where I'm trying to send list/array to MVC controller method: var id = []; var inStock = []; $table.find('tbody>tr').each(function() { ...
8
votes
6answers
3k views

ASP.NET MVC and Ajax, concurrent requests?

AJAX newbie here! At the moment in my ASP.NET MVC web app my AJAX requests appear to be getting batched or queued, im not sure. No requests seem to be getting completed until the previous request has ...

1 2 3 4 5 58
15 30 50 per page