2021年4月27日星期二

How to trigger controller and open new page (along with model) with ajax

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);          }  
https://stackoverflow.com/questions/67293533/how-to-trigger-controller-and-open-new-page-along-with-model-with-ajax April 28, 2021 at 11:53AM

没有评论:

发表评论