Escaping double quotes

Occasional Visitor

I'm trying to show/hide a div based on a dynamic value and I've escaped the double quotes in my code:




<div id="showhide"  @(singleCategory.ShowTime == "1" ? "style=\"display:none\"" : "")>





However, it doesn't work in the browser and when I do a View Page Source I see:




<div id="showhide"  style=&quot;display:none&quot;>




Thanks for any assistance,

0 Replies