❔ 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
What do you mean "from one page to another"?
from one .cshtml to another .cshtml
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?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
Why not fetch the same data with
/bar
?I'm learning and for some reason i was set on passing data using asp-route-data. i did just achieve what you mentioned
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
ok, i thought that's why i was having trouble
thank you
Anytime
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.