I have button onto click,its takes the input values and redirect to another page in javascript which something looks like this window.location = "Action Param1=value1&Param2=Value2"
. But the method uses query string which i want to avoid.
So i thought of using ajax
` $.ajax({
type: "POST",
url: "/MyController/MyAction",
data: '{Param1:"value1",Param2:"value2"}',
contentType: "application/json,charset=utf-8",
dataType: "json",
success: function () {
}
});`
This does call the controller but does not return anything. I don't know what i am doing wrong here, a working code would be appreciated.