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

color:red

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
Posted

1 solution

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

It will be ugly HTML code, but it works
 
Share this answer
 

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