title: Href Link Code Behind
body: <p>I am trying to add a a link as part of the Product.Text but I've horribly got it wrong here, doing this on the C-Sharp code behind. </p>
  
  <pre><code>tcProduct.Text = "&lt;div class=\"productname\"&gt;" + "&lt;a class=\"productnameLink\" href=\"item.Product.Url\"&gt;" + item.Product.Name + "&lt;/a&gt;" + "&lt;/div&gt;";
  </code></pre>
  
  <p>The backward slashes are beginning to confuse me. Instead of a normal hyperlink i guess i should be using the .NET hyperlink instead??</p>
  
  <p>I've tried this but doesn't add the hyperlink;</p>
  
  <pre><code>            HyperLink productNameLink = new HyperLink();
              productNameLink.Text = "&lt;div class=\"productname\"&gt;" + item.Product.Name + "&lt;/div&gt;"; 
              productNameLink.NavigateUrl = item.Product.Url.ToString();
              productNameLink.CssClass = "prodNameLink";
              tcProduct.Controls.Add(productNameLink);
  </code></pre>