I am using ASP.Net mvc to render my html view.
The view contains a dropdown list and a label
I load drop down list using a collection in my view model.
Lets say that the collection is called fruit
Fruit is defined as
The dropdown list will display each Fruit name and have a value of FruitId
When I change the value of the drop down list I want to have the value of my label display FruitType.
I can think of a couple ways of doing this:
I have 2 questions:
- Am I missing something obvious, could this be done in a better way?
- If no 2 is a good idea, where should I put the json in the html so that the js can use it?