Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: August 2, 2025, 12:03 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MVC .NET Labelfor
#1
MVC .NET Labelfor
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
Reply



Messages In This Thread
MVC .NET Labelfor - by ErGingerbreadMandude - May 26, 2016 at 10:25 pm
RE: MVC .NET Labelfor - by bennyboy - May 29, 2016 at 2:42 am
RE: MVC .NET Labelfor - by ErGingerbreadMandude - May 29, 2016 at 3:52 am
RE: MVC .NET Labelfor - by Marsellus Wallace - May 29, 2016 at 4:28 am
RE: MVC .NET Labelfor - by ErGingerbreadMandude - May 29, 2016 at 2:14 pm
RE: MVC .NET Labelfor - by Marsellus Wallace - May 30, 2016 at 9:22 am
RE: MVC .NET Labelfor - by bennyboy - May 30, 2016 at 12:10 pm
RE: MVC .NET Labelfor - by Marsellus Wallace - May 30, 2016 at 12:14 pm
RE: MVC .NET Labelfor - by Jackalope - May 31, 2016 at 2:58 am
RE: MVC .NET Labelfor - by bennyboy - May 29, 2016 at 7:19 am
RE: MVC .NET Labelfor - by ErGingerbreadMandude - May 29, 2016 at 2:12 pm
RE: MVC .NET Labelfor - by Jackalope - May 29, 2016 at 1:56 pm
RE: MVC .NET Labelfor - by ErGingerbreadMandude - May 29, 2016 at 2:10 pm
RE: MVC .NET Labelfor - by KevinM1 - May 30, 2016 at 1:10 pm
RE: MVC .NET Labelfor - by bennyboy - May 30, 2016 at 8:31 pm
RE: MVC .NET Labelfor - by IATIA - May 30, 2016 at 1:26 pm
RE: MVC .NET Labelfor - by KevinM1 - May 30, 2016 at 10:50 pm
RE: MVC .NET Labelfor - by bennyboy - May 30, 2016 at 11:35 pm
RE: MVC .NET Labelfor - by KevinM1 - May 31, 2016 at 10:37 am
RE: MVC .NET Labelfor - by bennyboy - May 31, 2016 at 12:05 pm
RE: MVC .NET Labelfor - by KevinM1 - May 31, 2016 at 11:12 am
RE: MVC .NET Labelfor - by KevinM1 - May 31, 2016 at 12:51 pm
RE: MVC .NET Labelfor - by bennyboy - May 31, 2016 at 8:04 pm
RE: MVC .NET Labelfor - by KevinM1 - June 2, 2016 at 11:39 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  The devil argues for Net Neutrality Sterben 6 1301 December 13, 2017 at 3:18 am
Last Post: Sterben
  Another Net Neutrality thread Sterben 7 1342 December 8, 2017 at 9:02 am
Last Post: Edwardo Piet
  Thank god, I finished this MVC project finally ! WinterHold 6 1596 April 4, 2015 at 10:28 pm
Last Post: bennyboy
  .NET vs JAVA Marsellus Wallace 28 7991 March 30, 2015 at 4:25 pm
Last Post: bennyboy



Users browsing this thread: 1 Guest(s)