title: Error message position in mvc razor
body: <p>I'm trying to put custom error messages for a login and registration forms.</p>
  
  <p>So far I have the form to check if there's an email already registered, if it is, it will return</p>
  
  <pre><code>Response.Write("There's already someone with that email")
  </code></pre>
  
  <p>But the problem with this is that the message will only appear on the top of the website.</p>
  
  <p>Is there a way I could display these error messages somewhere else?</p>
  
  <p>I know that in the model I could just put</p>
  
  <pre><code>[Required(ErrorMessage = "Something here")]
  </code></pre>
  
  <p>And then just put in the view somewhere</p>
  
  <pre><code>@Html.ValidationMessageFor(a =&gt;a.Email)
  </code></pre>
  
  <p>and it will display the error there.</p>
  
  <p>The code that I have for now is this:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Register(Registration signingUp)
      {
  
  
          var db = new ShareRideDBEntities();
  
          if (ModelState.IsValid)
          {
              //find if email is already signed up
              var FindEmail = db.tblProfiles.FirstOrDefault(e =&gt; e.PROF_Email == signingUp.Email);
              //if email is not found up do this
              if (FindEmail == null)
              {
                  var Data = db.tblProfiles.Create();
                  Data.PROF_Password = signingUp.Password;
                  Data.PROF_Email = signingUp.Email;
                  db.tblProfiles.Add(Data);
  
                  int Saved = db.SaveChanges();
  
                  if (Saved != 0)
                  {
                      Response.Write("Registration Successful.");
                  }
  
                  else
                  {
                      Response.Write("There was an error.");
                  }
  
              }
              else
              {
                  Response.Write("There's already an user with that email.");
                  return View();
              }
          }
          else
          {
              Response.Write("Fill all the fields to continue.");
          }
  
  return View();
  </code></pre>
  
  <p>Now if I do this with an existing email it will return "There's already an user with that email." but it will be display on the top of the website.</p>
  
  <p>How can I make this error message be displayed somewhere else?</p>
  
  <p>I heard something with @Html.Raw() but I'm confused on how to use it.</p>