title: RequiredFieldValidator to prompt ModalPopupExtender
body: <p>I have a bunch of RequiredFieldValidators on a page and I would like the ErrorMessage="" to display in a ModalPopupExtender rather than on the page. So when they click submit and a textbox isn't filled out, a ModalPopupExtender would come up on the screen and say "Text Box is Required" rather than on the page where the RequiredFieldValidator is placed. </p>
  
  <p>Here is an example of my code (posting my whole page would be far too large):</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
  &lt;div class="container"&gt;
  &lt;div class="row"&gt;
          &lt;div class="span3"&gt;
              &lt;div class="control-group"&gt;
                  &lt;asp:Label ID="NameLbl" class="control-label required" runat="server" Text="Name"&gt;&lt;/asp:Label&gt;
                  &lt;div class="controls"&gt;
                      &lt;asp:TextBox ID="NameTxtBox" class="span3" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;span
                          class="help-block"&gt;&lt;asp:RequiredFieldValidator ID="NameRFV" class="RFV" runat="server"
                              ErrorMessage="Name is Required" ControlToValidate="NameTxtBox"&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
           &lt;div class="span3"&gt;
              &lt;div class="control-group"&gt;
                  &lt;asp:Label ID="Email" class="control-label required" runat="server" Text="Email"&gt;&lt;/asp:Label&gt;
                  &lt;div class="controls"&gt;
                      &lt;asp:TextBox ID="EmailTxtBox" class="span3" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;span
                          class="help-block"&gt;&lt;asp:RequiredFieldValidator ID="EmailRFV" class="RFV" runat="server"
                              ErrorMessage="Required" ControlToValidate="EmailTxtBox"&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
       &lt;asp:Button ID="Button1" class="btn btn-primary" runat="server" Text="Submit"
                  OnClick="Submit_Click" /&gt;
       &lt;/div&gt;
      &lt;/form&gt;
  
      &lt;asp:scriptmanager id="ScriptManager1" runat="server"&gt;
              &lt;/asp:scriptmanager&gt;&lt;asp:ModalPopupExtender ID="ModalPopupExtender1" cancelcontrolid="btnCancel"
  targetcontrolid="Button1" popupcontrolid="SavePopup" 
  backgroundcssclass="ModalPopupBG" runat="server"&gt;
              &lt;/asp:ModalPopupExtender&gt;
              &lt;asp:panel id="SavePopup" style="display: none" runat="server"&gt;
              &lt;div class="ModalPopup"&gt;
              &lt;h4&gt;Fields Missing!&lt;/h4&gt;
                  &lt;p&gt;Name is Required, Email is Required.&lt;/p&gt;
                  &lt;input id="btnCancel" type="button" value="Close" /&gt;&lt;/div&gt;
           &lt;/asp:panel&gt;
  </code></pre>
  
  <p>Here is a mockup of how I want it when the user hits the Submit button they should see a modelpopup like this saying which fields are empty. </p>
  
  <p><img src="https://i.stack.imgur.com/zxRLp.jpg" alt="enter image description here"></p>
  
  <p>Any ideas on how to accomplish this? Do I keep the requiredfieldvalidators inside the modalpopupextender but then how to do I determine if the modalpopupextender gets activated, I don't want it coming up if all the fields have text within them.</p>