Groups > Asp .Net > Getting started with ASP.NET > Re: Wizard Problem - Cancel Button




Wizard Problem - Cancel Button

Wizard Problem - Cancel Button
Thu, 3 Apr 2008 17:29:01 +0000
I have a problem with a modal popup, my validation controls and a wizard.  If a
user clicks on the cancel button I show my modal popup but if you click on Yes
or No nothing happens.  I know the problem is because the validation on the
textboxes (surname, forenames, etc) is stopping the Yes or No events from
firing.  In my Cancel button I tried this code: -

Protected Sub Wizard1_CancelButtonClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Wizard1.CancelButtonClick
       If Page.IsValid = False Then
            e.Cancel = True
            ModalPopupCancelApp.Show()
        End If
End Sub

But I get the following error: -
Compilation Error
Description: An error occurred during the compilation of a resource required to
service this request. Please review the following specific error details and
modify your source code appropriately. 

Compiler Error Message: BC30456: 'Cancel' is not a member of
'System.EventArgs'.

Source Error:





Line 184:    Protected Sub Wizard1_CancelButtonClick(ByVal sender As Object,
ByVal e As System.EventArgs) Handles Wizard1.CancelButtonClick
Line 185:        If Page.IsValid = False Then
Line 186:            e.Cancel = True
Line 187:            ModalPopupCancelApp.Show()
Line 188:        End If

Here's a screenshot of my page: -
Post Reply
Re: Wizard Problem - Cancel Button
Thu, 3 Apr 2008 20:48:01 +0000
This is telling you that this type of event doesn't have a Cancel method.

I'm not really sure what you're trying to cancel here - validation?  If that's
the case, then set the CausesValidation property on the cancel button to False
instead.
Post Reply
Re: Wizard Problem - Cancel Button
Thu, 3 Apr 2008 20:48:40 +0000
hehe typical I forgot to set CausesValidation to False for both the Yes and No
buttons. :)

 Cheers plunkg you was right I didn't need that code.
Post Reply
about | contact