C
C#8mo ago
G

❔ razor pages List custom class

Is it possible to pass data of a List<custom class type > from one page to another? With the options I seen so far, it makes me believe I can only pass strings or integers
10 Replies
Angius
Angius8mo ago
What do you mean "from one page to another"?
G
G8mo ago
from one .cshtml to another .cshtml
Angius
Angius8mo ago
So... user goes to /foo, changes some values or what have you, in a form or something, then they go to /bar and the values are reflected there?
G
G8mo ago
my bad, it must be obvious i'm a noob. /foo has an action that gets a List of data from a db. I'm trying to pass the List<> data from /foo to /bar
Angius
Angius8mo ago
Why not fetch the same data with /bar?
G
G8mo ago
I'm learning and for some reason i was set on passing data using asp-route-data. i did just achieve what you mentioned
Angius
Angius8mo ago
Just know that this data will be passed in the URL, so it will be visible plainly, saved in the browser history, and has a length limit
G
G8mo ago
ok, i thought that's why i was having trouble thank you
Angius
Angius8mo ago
Anytime Ok
Accord
Accord8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.