title: Preventing XSS attacks in C# MVC4
body: <p>I have the following controller code:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Reset(FormCollection form)
      {
          string[] userName = form.GetValues("username");
  
          Models.HomeModel hm = new Models.HomeModel();
  
          //Check this map exists, as in the user actual exists
          //at all.
          if (!hm.UserExists(userName[0]))
              return View("Index");
  
          if (hm.CheckForExistingLink(userName[0]))
              return View("LinkExists");
  
          if (hm.CreateLink(userName[0]))
              return View("Success");
          else
              return View("UnSuccessful");
  
      }
  </code></pre>
  
  <p>If the user enters <code>&lt;b&gt;</code> as the username then it is throwing an application error, what is the simplest way to prevent XSS? I had a look at the Sanitizer AntiXSS but after adding it to the project and seeing it available in the referneces I am still not able to call it</p>