CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: strange problem with Wizard Steps

  1. #1
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    strange problem with Wizard Steps

    Hi All,

    I have my wizard step declared as:

    Code:
       <asp:Wizard ID="Wizard1" runat="server" StepStyle-Width="650" StepStyle-Height="150" StepStyle-VerticalAlign="Top" DisplaySideBar="false" Height="397px" Width="788px" OnNextButtonClick="SkipStep" OnPreviousButtonClick="RemoveStep">
    SkipStep is declared as:

    Code:
    Public Sub SkipStep(ByVal sender As Object, ByVal e As WizardNavigationEventArgs)
    During the SkipStep Event on one of the Steps, I have this code:

    Code:
    If e.CurrentStepIndex = 2 AndAlso chkInvestigators1.Checked = True Then
    
    'some code here
                e.Cancel = True
            End If
    This all seems to work fine in that if the above test is true, then e.cancel sets to true and on return, the wizard is on the same step. The problem I have is that only in the above senario, 2 steps on and the page crashes and it doesn't appear to trigger any events.

    So if my currentstepindex is 2 but my checkbox isn't checked, then the stepindex goes to 3 and everything works fine going onto step index 3 then 4 etc.

    SO to re-iterate if cancel gets set the wizard stays on the current step. If I then do not check my checkbox, the wizard sets the next step correctly (currentStepIndex sets to 3). I then press next and CurrentStepIndex sets to 4 Correctly. If i press next the system Crashes and it's only when I go through the leg at stepindex set to 2 when I have cancelled that it crashes.
    If you find my answers helpful, dont forget to rate me

  2. #2
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Re: strange problem with Wizard Steps

    experimenting further, I can place cancel = true on any currentstepindex < 4 and it will always crash when currentstepindex is moving from 4 to 5. If I do not set cancel = true on any stepindex then it never crashes and will always go to stepindex 5
    If you find my answers helpful, dont forget to rate me

  3. #3
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Re: strange problem with Wizard Steps

    ok if I place EnableViewState="false" against the <asp:Wizard declaration then everything works fine in terms of navigating the wizard. i.e. setting e.cancel = true works.

    However, the downside is that I loose persistance across each wizard step, and because I haven't got a specific page to redirect to (since this is in the hands of the wizard), How do I go about persisting my data across each step?
    If you find my answers helpful, dont forget to rate me

  4. #4
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Re: strange problem with Wizard Steps

    with :

    EnableViewState="false" on the <asp:wizard

    I thought that If I introduce a hidden control :

    Code:
    <asp:HiddenField ID="HiddenField1" runat="server" EnableViewState="true" />
    and set the value, then the EnableViewState here would override that of the Wizard. It appears not. So after setting the hiddenfield value in step2 for example, when I go to wizardstep3 the hiddenfield's value has been lost.
    If you find my answers helpful, dont forget to rate me

  5. #5
    Join Date
    Mar 2008
    Posts
    1

    Re: strange problem with Wizard Steps

    Hi sir

    May be late but I got a problem similar to this one.

    When I use only 3-pages asp.net wizard and I click next and previous buttons then after a few clicks the wizard hangs up.

    I am using basic membership Wizard tutorial from microsoft.


    Please help?
    Any Ideas?

    Majid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)