I'm having this issue and i'm stumped. I'm able to pass and received single object but If I try to pass a list, the data is not going to the second page.
Here is my OrderList Page
[BindProperty]
public IList<Orders> Orders{ get; set; }
public ActionResult OnPost()
{
//get modified data.
var orderList = Orders
return RedirectToPage("/ConvertToCsv", orderList );
}
on my ConvertToCsv page.
public void OnGet(IList<Orders> orderList )
{
//do something with list.
}
But the orderlist on OnGet is null.
I tested by passing a single record like
public ActionResult OnPost()
{
return RedirectToPage("/ConvertToCsv", new{orderId= "test"});
}
public void OnGet(string orderId )
{
//This works.
}
What am I doing wrong?