You can do it by not initializing url and writing it at hardcode like this
//var url = '@Url.Action("ActionName", "Controller");
$.post("/Controller/ActionName?para1=" + data + "¶2=" + data2, function (result) {
$("#" + data).html(result);
............. Your code
});
While your controller side code must be like this below:
public ActionResult ActionName(string para1, string para2)
{
Your Code .......
}
this was simple way. now we can do pass multiple data by json also like this:
var val1= $('#btn1').val();
var val2= $('#btn2').val();
$.ajax({
type: "GET",
url: '@Url.Action("Actionre", "Contr")',
contentType: "application/json; charset=utf-8",
data: { 'para1': val1, 'para2': val2 },
dataType: "json",
success: function (cities) {
ur code.....
}
});
While your controller side code will be same:
public ActionResult ActionName(string para1, string para2)
{
Your Code .......
}