title: Is it possible to set a new asp Hyperlink from Code Behind
body: <p>I am wondering if it is possible to have an asp hyperlink on an aspx page and in the code behind set it to a new hyperlink in the Page_Load section.  I've tried this and it appears not to work, but wanted to know more about the mechanics (is this something that just doesn't work, or could work earlier in the page lifecycle, or why it doesn't work).</p>
  
  <p><b>Example Code</b></p>
  
  <p><i>Aspx Page</i><br /></p>
  
  <pre><code>&lt;asp:HyperLink ID="myHyperLink" runat="server" /&gt;
  </code></pre>
  
  <p><i>Code Behind</i><br /></p>
  
  <pre><code>var newHyperLink = new HyperLink();
  newHyperLink.NavigateUrl= url;
  newHyperLink.Text = "Hello World";
  myHyperLink = newHyperLink;
  </code></pre>