Sending Ajax Request when Dropdown change in ASP.NET MVC


This is a simple example which send an ajax request to the ActionResult and return a JsonResult.

jQuery script for sending the request

$("#YourDropDownId").change(function() {
var ServiceUrl ="/YourController/Action?id=" + 1;
var content = '';
$.support.cors = true;
type: 'GET',
url: ServiceUrl,
async: true,
cache: false,
crossDomain: true,
contentType: "application/json; charset=utf-8",
dataType: 'json',
error: function (xhr, err) {
success: function (result, status) {


public ActionResult Action(int id)
var result = new { Value = "my Json result" };
return Json(result, JsonRequestBehavior.AllowGet);

Enjoy Coding…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s