Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <code>Display="None"</code> attribute on the FieldValidator control and a <code>ValidationSummary</code> tag to contain the messages.</p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;asp:TextBox runat="server" ID="TextBox1" /&gt; &lt;br /&gt; &lt;asp:TextBox runat="server" ID="TextBox2" /&gt; &lt;br /&gt; &lt;asp:Button runat="server" Text="Go" /&gt; &lt;div class="messages"&gt; &lt;asp:ValidationSummary id="summery1" runat="server"/&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Panel ID="Panel1" runat="server" &gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required Field Validator1 empty" ControlToValidate="TextBox1" Display="None" /&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Required Field Validator2 empty" ControlToValidate="TextBox2" Display="None" /&gt; &lt;/asp:Panel&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>HOWEVER....(there's always a catch)... with this method, the Validation Messages themselves are stored in the JavaScript only. Meaning that it won't work if Javascript is disabled. I'm assuming that's not a huge problem since you are working in WebForms (which rely on JS), but I figure it's worth mentioning.</p> <p>And for the record, accessibility concerns are mostly a crock of horse-crap. I THOUGHT I knew about accessibility until I actually worked with a visually impaired programmer (100% blind). Then, I learned that JS works just fine (assuming they know to look for new content...) and that they just skip around the page from link to link until they find what they are after. And table-based layouts didn't slow them down for 1 second. Boy that was a tough pill to swallow after being SOOO unbearably preachy about CSS for a few years....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload