Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

exception when updating a Formview within WizardControl

i have a wizard control , i tried to put all the insert command and update commands withing the ( Next , Previous ) buttons of the wizard , the code i use is :

Protected Sub Wizard1_PreviousButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.PreviousButtonClick
        Select Case e.CurrentStepIndex
            Case 2
                Select Case FormView2.CurrentMode
                    Case FormViewMode.Insert
                        FormView2.InsertItem(True)


                    Case FormViewMode.Edit
                        FormView2.UpdateItem(True)

                End Select


        End Select
    End Sub


when i test this code , i get the following error

Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control that has CausesValidation=True and initiated the postback, or after a call to Page.Validate.


any help on this issue ?
0
nasemabdullaa
Asked:
nasemabdullaa
1 Solution
 
Easwaran ParamasivamCommented:
Control validation has to be done. If it is valid then Page.Validate() should be called in your method. Please check the link:  http://forums.asp.net/t/1106963.aspx/1
0
 
nasemabdullaaAuthor Commented:
its working now
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now