title: How do I generate ActionLink from code behind in Mvc?
body: <p>On <code>HomeController.cs</code> code :</p>
  
  <pre><code> if (User.Identity.IsAuthenticated)
              {
                  var profile = Profile.GetProfile(User.Identity.Name);
                  ViewData["Message"] = "Welcome " + profile.FirstName + "!";
              }
              else
              {
                  ViewData["Message"] = "Welcome to myblog.";
                  ViewData["RegisterLink"] = "please register &lt;%:Html.ActionLink('Register', 'Register', 'Account')%&gt;.";
              }
  </code></pre>
  
  <p>If user is not logged in it should have to show 
  welcome to myblog and please register (it must be actionlink)</p>
  
  <p>and on index.aspx inside Content code is:</p>
  
  <pre><code>  &lt;%:  ViewData["RegisterLink"] %&gt;
  </code></pre>
  
  <p>But I'm failed to generate ActionLink please help.</p>