title: Display the Result of RemoteAttribute in MVC 3.0
body: <p>I have a ViewModel setup to use RemoteValidation using the <code>RemoteAttribute</code>. It works fine.</p>
  <h2>EDIT</h2>
  <blockquote>
  <p>Updated it a bit to show some fixed code.</p>
  <p>I want to point out that this is not my actual &quot;Register&quot; code. This is testing it so I can use it in other situations. I'm not having users register using flat names!</p>
  </blockquote>
  <p>Here are the libraries I am referencing, and how I am referencing them.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.js&quot;&gt;&lt;/script&gt;
  
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>Here is how I am wiring the RemoteAttribute.</p>
  <pre><code>public class UserRegistrationModel
  {
      [Required]
      [RegularExpression(@&quot;^(?:[a-zA-Z\p{L} \.'\-]{3,48})$&quot;, ErrorMessage = &quot;This name contains invalid characters. Names must be between 3 and 48 characters, contain only standard unicode symbols, and may not contain any punctuation other than the ['] and [-] symbols.&quot;)]
      [Remote(&quot;ValidateUserName&quot;, &quot;Membership&quot;, ErrorMessage = &quot;{0} is invalid.&quot;)]
      public string Name
      {
          get;
          set;
      }
  }
  </code></pre>
  <p>And then here is the actual controller behavior.</p>
  <pre><code>    public ActionResult ValidateUserName(string name)
      {
          // perform logic
  
          if (true)
              return Json(true, JsonRequestBehavior.AllowGet);
  
          return Json(false, JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  <p>I have inspected my HTML, and this functions as I want. But I don't understand what to do from there. How can I display that information to the user? It just stores it in the html</p>
  <p><code>data-val-remote=&quot;* is invalid&quot;</code></p>
  <p>I have watched, and I notice that even when the <code>RemoteAttribute</code> returns false, the html changes from</p>
  <p><code>value</code> to <code>value class=&quot;valid&quot;</code>, but in my other model validations, this changes to `class=&quot;input-validation-error&quot;'.</p>
  <p>So does anyone have any clues on how to draw the remote message back? Or is there really nothing I can do?</p>