I want to call MVC controller method from Jquery. Below is my code but it is not working
Controller:
public ActionResult singleValue(string valuetoset)
{
//Code
}
JQuery:
$('#User').live('change', function (e) {
var userValue = e.target.options[e.target.selectedIndex].value;
$.ajax({
url: "/Home/singleValue",
type: 'GET',
data: { valuetoset: userGuideValue },
success: function (result) {
alert(result);
},
error: function () {
alert("error");
}
});
});
I need to pass valuetoset argument, but it always going as null