Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

RequiredFieldValidator fails when Master page button clicked

$
0
0

I have been using the requiredfieldvalidator in all of my content pages and they worked fine for the content page button clicks and prevents the post back.
But I am using the same Validation group on the master page button and also I have set the Causes Validation to true, but it doesn't seem to stop the postabck of the content page.

Master Page Button:

<asp:Button ID="SaveBtn" runat="server" Text="File" CssClass="buttonnormal" Width="62px"
Style="float: right" OnClick="SaveBtn_Click" ValidationGroup="Validate"
CausesValidation="true" />

Used In content Page:

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="<b>Missing Field</b><br />Please enter Date." ControlToValidate="Date" ValidationGroup="Validate" Display="None" SetFocusOnError="true" EnableClientScript="true"></asp:RequiredFieldValidator>



I create use delegate functionality by which I have only one Save button for my around 25 content pages. So it fails for the master page and content page communication.


Viewing all articles
Browse latest Browse all 23244

Trending Articles