Click here to Skip to main content
14,825,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on mvc4 and my questoin is i am getting color name from database like below


I want to convert this string that is red to color and display in my view using the razor i am new to the mvc please mentioned me the code how to implement in view

1 solution

Do you mean something like this?
<span style="@model.YOUR_COLOR_PROP">TEXT</span>

It will be ugly HTML code, but it works

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900