I have a submit button using the Microsoft ConfirmButton Extender to ask: "Are you sure?". However, it fires regardless of whether the page passes the check on the client side.
<asp:TextBox ID="TextBox1" runat="server" /> <asp:RequiredFieldValidator ID="RequiredFieldValidatorTextBox1" runat="server" ControlToValidate="TextBox1" ErrorMessage="First name is required" Display="Dynamic" /> ... <asp:Button ID="Button1" runat="server" Text="Submit" CausesValidation="True" /> <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtenderButton1" runat="server" TargetControlID="Button1" ConfirmText="Are you sure?" /> ... <asp:ValidationSummary id="ValidationSummary1" runat="server" ShowMessageBox="True" />
So, if the user leaves the required field blank and clicks the "Submit" button. She will see two message boxes:
One for checking ...
ValidationSummary ShowMessageBox http://img120.imageshack.us/img120/8305/validationzn6.gif
Then one to confirm ...
ConfirmButtonExtender http://img228.imageshack.us/img228/678/confirmationam3.gif
(Note: OK and Cancel both will simply be canceled.)
, , . . ?
Update:
ConfirmOnFormSubmit, :
(ASP.Net): "ConfirmOnFormSubmit" 'ConfirmButtonExtender'.
Validation (ASP.Net): "ConfirmOnFormSubmit" "ConfirmButtonExtender" . <3 >
, ConfirmOnFormSubmit TRUE ConfirmButtonExtender.
:
ConfirmOnFormSubmit - , . , ASP.NET, .
: . intellisense , , .
Source: https://habr.com/ru/post/1702312/More articles:Git Best Practice: How do you celebrate a revision of "TESTED" or "REJECTED" - gitgetting java bean property of unknown class - javaHow to create a request like "filter by price"? - sqlПерестановка двух строк в MS SQLServer с сохранением исходного первичного ключа и без обновления вручную - sqlHow to avoid duplication of app.config with unit testing of Visual Studio 2008? - .netHow to avoid duplication of settings when using 2 projects and 2 test projects in Visual Studio? - .netVisual Studio 2010 - WPF / Silverlight and Embedded Grid - .netРесурсы диаграммы классов UML - javaSCCS "what" lines are not optimized by the compiler - cReading user rights with VBscript - vbscriptAll Articles