I have a page using .NET server side input validation elements. This page also has a javascript confirmation window that launches when the form is submitted. Currently, when the Submit button is selected, a javascript confirmation window appears, and as soon as it is confirmed, ASP.NET server-side validation elements are activated. I would like to run control checks on the server side before the javascript confirmation window displays.
How can I do that? Ive included a sample of my current code below.
Sample.aspx
<asp:textbox id=foo runat=server />
<asp:requiredfieldvalidator id=val runat=server controltovalidate=foo />
<asp:button id=submit runat=server onClientClick=return confirm('Confirm this submission?') />
sample.aspx.vb
Sub Page_Load()
If Page.IsPostback() Then
Page.Validate()
If Page.IsValid Then
'process page here'
End If
End If
End Sub
Thanks for any help.
Michael
source
share