How pass objects from one page to another on ASP.Net Core with razor pages?

You can pass parameters to specified handlers in the page model class, like this:

return RedirectToPage("Orders", "SingleOrder", new {orderId = order.Id});

Where the page model class method has this signature:

public void OnGetSingleOrder(int orderId)

If you are passing an object, you can pass the object directly, but in my experience any child objects are not populated.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)