C
C#2y ago
4

✅ cshtml file System.NullReferenceException

data didn't came to user (variable)
12 Replies
Angius
Angius2y ago
k
4
4OP2y ago
Angius
Angius2y ago
Don't try getting user here, get it in the controller
4
4OP2y ago
Angius
Angius2y ago
Well, user is null here Is the user logged in?
4
4OP2y ago
yes What do you think could be the problem?
Angius
Angius2y ago
User not being logged in would be one idea Another would be that this in the view is something else than it is in the controller
4
4OP2y ago
I removed authorization
Angius
Angius2y ago
So I'd make the user part of the model, and get them in the controller Not in the model
4
4OP2y ago
still don't work
Angius
Angius2y ago
Show code The view and the controller
Accord
Accord2y 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