title: Razor add new attribute to HTML
body: <p>I want to add a new attribute to my HTML dynamically, but I can't figure out how to do this;</p>
  
  <p>I have some Facebook like button code, where I want to add a "data-url" attribute if the Url property in my model is specified.</p>
  
  <p>I've tried a couple of things but this is what my code looks like now:</p>
  
  <pre><code>&lt;a href="https://twitter.com/share" class="twitter-share-button" @if (!string.IsNullOrEmpty(Model.Url)) { data-url="@Model.Url" } data-text="@Model.TweetText" data-count="vertical" data-via="avalaxy"&gt;Tweet&lt;/a&gt;&lt;script type="text/javascript" src="//platform.twitter.com/widgets.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This does not work. So how do I do this?</p>