MVC .NET Labelfor
May 26, 2016 at 10:25 pm
(This post was last modified: May 26, 2016 at 10:25 pm by ErGingerbreadMandude.)
I was wondering if anyone knew how I can access data stored in a variable in my model from my view?
Like for example :
Labelfor (model.subject,"English")
I want "English" to be taken from my model data like
Labelfor(model. subject, model.subjectobj.subject)
I have a subject in my model to enter the mark and I have a subject object in the same model which connects to a model that contains all the subjects.
So my view looks like this
(entering mark)
Subject: _______(text box)
I want my view to be able to access the data from subject object. Subject (string) and look like this:
(entering mark)
English :________(text box)
Any ideas? I'm using visual studio 2015
Like for example :
Labelfor (model.subject,"English")
I want "English" to be taken from my model data like
Labelfor(model. subject, model.subjectobj.subject)
I have a subject in my model to enter the mark and I have a subject object in the same model which connects to a model that contains all the subjects.
So my view looks like this
(entering mark)
Subject: _______(text box)
I want my view to be able to access the data from subject object. Subject (string) and look like this:
(entering mark)
English :________(text box)
Any ideas? I'm using visual studio 2015