C
C#14mo 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
Angius14mo ago
What do you mean "from one page to another"?
G
GOP14mo ago
from one .cshtml to another .cshtml
Angius
Angius14mo 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
GOP14mo 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
Angius14mo ago
Why not fetch the same data with /bar?
G
GOP14mo 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
Angius14mo 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
GOP14mo ago
ok, i thought that's why i was having trouble thank you
Angius
Angius14mo ago
Anytime Ok
Accord
Accord14mo 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.
Want results from more Discord servers?
Add your server