❔ ❔ MVC - Chart - Model - NullReferenceException
I'm using google chart to display my data.
The chart works by default, but when I change the foreach data dispay, it disappears.
@model List<BloodSugarData>
...
20 Replies
The problem should be in the foreach line imo, but I don't know what
+picture: the data shows up when I only use the same foreach in a table, but I need it in a chart
Update: System.NullReferenceException - Model
Show your backend code
Data class (Model)
BSDiagram Razor View
I can send code format too if needed
And the controller?
Well
I have to add the data into the controller<
?
You're not sending any data to the view
So hard to expect it to be there
okay understand
Whatever you pass to
View()
is available as Model
in the view
The @model Foo
in the view just tells it that the type of that Model
will be Foo
cool! thank you, I just got confused haha
🙂
Nice
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./close
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.