Making a Simple Ajax call to controller in asp.net mvc

Remove the data attribute as you are not POSTING anything to the server (Your controller does not expect any parameters). And in your AJAX Method you can use Razor and use @Url.Action rather than a static string: $.ajax({ url: ‘@Url.Action(“FirstAjax”, “AjaxTest”)’, contentType: “application/json; charset=utf-8”, dataType: “json”, success: successFunc, error: errorFunc }); From your update: $.ajax({ … Read more

How many Include I can use on ObjectSet in EntityFramework to retain performance?

A query with includes returns a single result set and the number of includes affect how big data set is transfered from the database server to the web server. Example: Suppose we have an entity Customer (Id, Name, Address) and an entity Order (Id, CustomerId, Date). Now we want to query a customer with her … Read more

jQuery Ajax calls and the Html.AntiForgeryToken()

I use a simple js function like this AddAntiForgeryToken = function(data) { data.__RequestVerificationToken = $(‘#__AjaxAntiForgeryForm input[name=__RequestVerificationToken]’).val(); return data; }; Since every form on a page will have the same value for the token, just put something like this in your top-most master page <%– used for ajax in AddAntiForgeryToken() –%> <form id=”__AjaxAntiForgeryForm” action=”#” method=”post”><%= Html.AntiForgeryToken()%></form> … Read more

ASP.NET MVC 2.0 Implementation of searching in jqgrid

Probably you have problem on the server side. Could you append your question with the code of DynamicGridData action which you currently use. The action should have filters as the parameter. Some parts of your current code are definitively wrong. For example jqGrid is the jQuery plugin. So the methods of jQuery will be extended … Read more