My ActionMethod
[HttpPost]
public JsonResult emailTemplate()
{
List<String> str = new List<String>();
str.Add("Mailto:?body=Hello1&subject=test subject1");
str.Add("Mailto:?body=Hello2&subject=test subject2");
return Json(str);
}
JavaScript Function in view
function SendMailClicked() {
$.ajax({
type: "POST",
url: "/Home/emailTemplate",
//data: "{'ReviewComponentIds':'1,2,3'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
jQuery.each(response, function () {
window.location.href = this + '\n';
});
},
failure: function (errMsg) {
alert('failure');
}
});
}