you can use Page_ClientValidate in your own confirmation function to decide whether to display a confirmation dialog. Sort of:
function validateAndConfirm(message){ var validated = Page_ClientValidate('group1'); if (validated){ return confirm(message); } }
And on the server you will have something like:
<asp:textbox id="TextBox1" runat="server"/> <asp:requiredfieldvalidator ValidationGroup="group1" ErrorText="Need to Fill in Value!" ControlToValidate="TextBox1" runat="server"/> <asp:textbox id="TextBox2" runat="server"/> <asp:requiredfieldvalidator ValidationGroup="group1" ErrorText="Need to Fill in Value!" ControlToValidate="TextBox2" runat="server"/>
And your button code will change to:
<asp:Button ID="btnCustomerUpdate" runat="server" CssClass="applybuttonstyle" Text="Update" onclick="btnCustomerUpdate_Click" ValidationGroup="group1" OnClientClick="return validateAndConfirm('Do you really want to update?');"/>
Obviously, I canβt verify this, but you get the point.
If you will use Page_ClientValidate , you may find this SO question useful.
source share