I have an ASP.net webpage hosting a form broken up into various update panels to improve the flow of the page. Without the tabs and update panels it would take the user a while to scroll all the way to the bottom.
I have various data tables that validate independently and their summaries show in the area I have designated for them. All of them fire when the full document is submitted to the server. All of this works as I expect it to.
However, I was asked to add File functionality to this page so i'm using an upload control, again, nested in it's own update panel (async trigger bound to button) When the Required validator correctly returns false and the error message shows, this works as intended.
The real issue here is that on a SUCCESSFUL validation (and postback) the ENTIRE page then attempts to re-validate and as such, all of the required fields register as false. This is the ONLY section of the page that displays this behaviour
Does anyone know, or can anyone suggest where I might find the information i'm clearly missing.
<asp:UpdatePanel runat="server" ID="uPnlDocs" UpdateMode="Conditional">
<Triggers>
<asp:PostBackTrigger ControlID="btnUploadFile" />
</Triggers>
<ContentTemplate>
<div id="DivDocs" runat="server" class="tab-pane" visible="false">
<div class="panel panel-default">
<div class="panel-heading">
<asp:Label ID="Label1" runat="server">
<h3><u>Supporting Documents</u></h3 >
<h4>Please upload any documents you would like to attach to the currently selected DRD record. </h4>
<h5>Click the "Browse/Choose File" button to select a file, Then click "Upload File"</h5>
</asp:Label>
</div>
<br />
<div class="panel-body">
<!-- Controls go in here -->
<asp:FileUpload runat="server" ID="DrdFile" CssClass="col-sm-3" ViewStateMode="Enabled" />
<asp:Button runat="server" CausesValidation="true" ValidationGroup="VGUpload" ID="btnUploadFile" Text="Upload File" CssClass="btn btn-success col-sm-2" OnClick="btnUploadFile_Click" />
<asp:RequiredFieldValidator runat="server" ID="RFV_Upload" ControlToValidate="DrdFile" Display="None" ValidationGroup="VGUpload" ErrorMessage="File not Selected" CssClass="validationError col-sm-6"></asp:RequiredFieldValidator>
<asp:Label runat="server" ID="lblUploadText" Text="Add a description to go with your file" CssClass="col-sm-12" AssociatedControlID="txtUploadFile" />
<asp:TextBox runat="server" ID="txtUploadFile" TextMode="MultiLine" Rows="4" CssClass="col-sm-10" />
</div>
</div>
UPDATE --
Through further research and testing I found that ALL of my validators are being fired not just the required field validators
According to MSDN; https://msdn.microsoft.com/en-us/library/hh882339(v=vs.110).aspx
I should be able to stop the validation from firing when the form is submitted by either;
Putting <@ PAGE validateRequest="false" %> in the page directive (tried)
Adding the settings to the web.config file (also tried)
I'm running out of ideas at this point I hope someone has figured this out.