title: How to change [DisplayName"xxx"] in Controller?
body: <p>Folks,</p>
  
  <p>I am MVC 2 newbie and stuck on this problem:</p>
  
  <p>AccountModuls.cs</p>
  
  <pre><code>public class LogOnModel
  {
  [Required]
  [DisplayName("User name")]
  public string UserName { get; set; }
  …
  }
  </code></pre>
  
  <p>LogOn.aspx</p>
  
  <pre><code>&lt;%: Html.LabelFor(m =&gt; m.UserName) %&gt;
  </code></pre>
  
  <p>The text “User name” will be finally displayed in the website - based on my definition </p>
  
  <p>[DisplayName("User name")].</p>
  
  <p>No Problem.</p>
  
  <p>But how can I change this text in AccountController.cs?</p>
  
  <pre><code>public ActionResult LogOn()
  {   
  return View();
  }
  </code></pre>