I have a link. Its triggers my ajax. I want to open a new page after this triger.
But it’s returning back to my ajax after the trigger. There is my code.
HTML
<a onclick="SiparisYazdir(@item.id)" >Print</a>
ajax
function SiparisYazdir(id)
{
$.ajax({
url: '/Order/Print',
type: 'GET',
data: { "value": value, 'id': id } // value is taking from another method.
});
}
controller
public IActionResult Print(int value, int id)
{
//taking model here
return View(model);
}
2
Answers
return View(model) will return the html content of your view
you cant put this html into your desired tag
If you want to redirect to another page, I think there is no need ajax here