I am quite new to Razor so could be missing something obvious. I have a:
@Html.DisplayFor(model => model.ColourValue, "")
that returns a colour value from the model. For Example: #004080.
How might I use this ColourValue to change the background and foreground colour of the control?
I am aware I may not be using the correct Html Helper... Any direction would be appreciated.
You should save the desired color value into another razor variable from the controller, then when you want to have an html element use that value you just place the razor variable, for example:
or just
remember that anything in the view that razor does is just plain text in the eyes of html