title: How do you add a single quote for javascript in an Html.TextBoxFor method?
body: <p>I am attempting to add a javascript method as a custom attribute in an Html.TextBoxFor method like this:</p>
  
  <pre><code>&lt;%: Html.TextBoxFor(model =&gt; model.DateCreated, new { size="15", onfocus="myObject.myFunction(this, 'DateCreated');return false;"}) %&gt;
  </code></pre>
  
  <p>The problem I'm experiencing is that the single quote characters are being html encoded, which is an expection I have of the <code>&lt;%:</code>. Is there a way to prevent the html encoding for just that piece (like using a \ to escape characters in strings)? Is there a different method of adding this custom attribute? Or am I just flat out doing this wrong?</p>