andleer
andleer

Reputation: 22568

MVC2 Quote handling / escaping within a style attribute

I have no idea how to handle this code within a style attribute. How do I correctly code this markup or properly escape it? I could use a string.format and emit the entire div but that seems like an awkward solution.

(I figured all those slant brackets would pose an issue in this posting so I am including an image.)

alt text

Upvotes: 1

Views: 146

Answers (1)

Tommy
Tommy

Reputation: 39807

I see this all the time in my editor as well, for some reason, it doesn't color the attributes properly sometimes in CSS and JS. However, the attribute that you are spitting out will should still perform like you are expecting.

Upvotes: 2

Related Questions