title: How to add a class to an ASP.NET control?
body: <p>I've been working on someone's project and noticed Visual Studio produces a message for each ASP tag that has a class attribute. For example: </p>
  
  <blockquote>
    <p>Attribute 'class' is not a valid attribute of element 'TextBox'.</p>
  </blockquote>
  
  <p>If I visit the website, it seems to work correctly. An example that produces the message looks like this:</p>
  
  <pre><code>&lt;asp:TextBox class="makeInline loginItem" ID="UserName" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>On the website it becomes this:</p>
  
  <pre><code>&lt;input type="text" class="makeInline loginItem" id="Login1_UserName" name="Login1$UserName"&gt;
  </code></pre>
  
  <p>So it looks like the class attribute gets carried over to the HTML tag. Is this fine, or is there a better way to do this?</p>