title: What's the correct way to output HTML attributes / text with quotes in Razor / MVC3?
body: <p>Lets say I have a function in my model, that generates a style tag based on an int</p>
  
  <pre><code>public string GetStyle(int? size){
      if(size &gt; 99)
          return "style=\"margin: 20px;\"";
      else
          return "";
  }
  </code></pre>
  
  <p>If I render this out using </p>
  
  <pre><code>&lt;li @GetStyle(123)&gt;123&lt;/li&gt;
  </code></pre>
  
  <p>It outputs this:</p>
  
  <pre><code>&lt;li style=""margin:20px;""&gt;123&lt;/li&gt;
  </code></pre>
  
  <p>(Note the double double-quotes). If I change the escaped double quotes in the function to <em>single</em> quotes, it outputs this:</p>
  
  <pre><code>&lt;li style="'margin:20px;'"&gt;123&lt;/li&gt;
  </code></pre>
  
  <p>Neither is correct, and I'm forced to either output an empty style tag if no style is required. </p>