Changing Next button text for wizard step.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M. Ali Qureshi

    #1

    Changing Next button text for wizard step.

    Hi,

    I have a wizard in my aspx page, and i create steps programatically . There
    are about 8 steps in all. The default text for StepNextButton is "Next". But
    i want that only in step 4, the next button text should be changed to
    something else. For example, "Continue to step 5". Is it possible? Here is
    my code for generating steps:

    =============== ===============
    Protected Sub HitRaterWiz_Ini t(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles HitRaterWiz.Ini t
    Dim CatAdapter As New
    HitRaterTableAd apters.Question CategoriesTable Adapter()
    Dim DataTable As HitRater.Questi onCategoriesDat aTable =
    CatAdapter.GetD ata()
    Dim row As HitRater.Questi onCategoriesRow
    Dim Counter As Integer = 1
    For Each row In DataTable
    Dim CatStep As New WizardStep
    CatStep.AllowRe turn = True
    Dim CatHeading As New Literal
    CatHeading.Text = "<div class=""CatHead ing"">" &
    row.QuestionCat egory.ToString( ) & "</div>"
    CatStep.Control s.AddAt(0, CatHeading)
    CatStep.Control s.AddAt(1,
    GetQuestionsTab le(row.Question CategoryID))
    HitRaterWiz.Wiz ardSteps.Add(Ca tStep)
    Counter += 1
    Next
    End Sub
    =============== ===============

    Thanks for help.

    Rgds.

  • oroussea@gmail.com

    #2
    Re: Changing Next button text for wizard step.

    On Jan 3, 9:51 am, "M. Ali Qureshi" <m.ali.qure...@ hotmail.comwrot e:
    Hi,
    >
    I have a wizard in my aspx page, and i create steps programatically . There
    are about 8 steps in all. The default text for StepNextButton is "Next". But
    i want that only in step 4, the next button text should be changed to
    something else. For example, "Continue to step 5". Is it possible? Here is
    my code for generating steps:
    >
    =============== ===============
        Protected Sub HitRaterWiz_Ini t(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles HitRaterWiz.Ini t
            Dim CatAdapter As New
    HitRaterTableAd apters.Question CategoriesTable Adapter()
            Dim DataTable As HitRater.Questi onCategoriesDat aTable =
    CatAdapter.GetD ata()
            Dim row As HitRater.Questi onCategoriesRow
            Dim Counter As Integer = 1
            For Each row In DataTable
                Dim CatStep As New WizardStep
                CatStep.AllowRe turn = True
                Dim CatHeading As New Literal
                CatHeading.Text = "<div class=""CatHead ing"">"&
    row.QuestionCat egory.ToString( ) & "</div>"
                CatStep.Control s.AddAt(0, CatHeading)
                CatStep.Control s.AddAt(1,
    GetQuestionsTab le(row.Question CategoryID))
                HitRaterWiz.Wiz ardSteps.Add(Ca tStep)
                Counter += 1
            Next
        End Sub
    =============== ===============
    >
    Thanks for help.
    >
    Rgds.
    Have you tried changing stepNextButtonT ext depending on the current
    step?

    http://msdn2.microsoft.com/en-us/lib...uttontext.aspx

    Comment

    • M. Ali Qureshi

      #3
      Re: Changing Next button text for wizard step.

      Hi,

      I created a test page and tried following very simple wizard, but it didnt
      work:

      =============== ============
      Protected Sub Wizard1_Init(By Val sender As Object, ByVal e As
      System.EventArg s) Handles Wizard1.Init
      For i As Integer = 1 To 8
      Dim CatStep As New WizardStep
      Dim CatLabel As New Label
      CatLabel.Text = "Step nr.: " & i.ToString()
      CatStep.Control s.AddAt(0, CatLabel)
      If i = 4 Then
      Wizard1.StepNex tButtonText = "Go to next step"
      Else
      Wizard1.StepNex tButtonText = "Next"
      End If
      Wizard1.WizardS teps.Add(CatSte p)
      Next
      End Sub
      =============== ===========

      Any idea?



      <oroussea@gmail .comwrote in message
      news:06b80aa2-1cd7-416a-9c23-4c56c159a2f0@p6 8g2000hsd.googl egroups.com...
      On Jan 3, 9:51 am, "M. Ali Qureshi" <m.ali.qure...@ hotmail.comwrot e:
      Hi,
      >
      I have a wizard in my aspx page, and i create steps programatically . There
      are about 8 steps in all. The default text for StepNextButton is "Next".
      But
      i want that only in step 4, the next button text should be changed to
      something else. For example, "Continue to step 5". Is it possible? Here is
      my code for generating steps:
      >
      =============== ===============
      Protected Sub HitRaterWiz_Ini t(ByVal sender As Object, ByVal e As
      System.EventArg s) Handles HitRaterWiz.Ini t
      Dim CatAdapter As New
      HitRaterTableAd apters.Question CategoriesTable Adapter()
      Dim DataTable As HitRater.Questi onCategoriesDat aTable =
      CatAdapter.GetD ata()
      Dim row As HitRater.Questi onCategoriesRow
      Dim Counter As Integer = 1
      For Each row In DataTable
      Dim CatStep As New WizardStep
      CatStep.AllowRe turn = True
      Dim CatHeading As New Literal
      CatHeading.Text = "<div class=""CatHead ing"">" &
      row.QuestionCat egory.ToString( ) & "</div>"
      CatStep.Control s.AddAt(0, CatHeading)
      CatStep.Control s.AddAt(1,
      GetQuestionsTab le(row.Question CategoryID))
      HitRaterWiz.Wiz ardSteps.Add(Ca tStep)
      Counter += 1
      Next
      End Sub
      =============== ===============
      >
      Thanks for help.
      >
      Rgds.
      Have you tried changing stepNextButtonT ext depending on the current
      step?

      http://msdn2.microsoft.com/en-us/lib...uttontext.aspx

      Comment

      • oroussea@gmail.com

        #4
        Re: Changing Next button text for wizard step.

        Yeah... you could handle the OnActiveStepCha nged event like this:

        <asp:Wizard ID="Wizard1" Runat="server"
        OnActiveStepCha nged="OnActiveS tepChanged"></asp:Wizard>

        Sub OnActiveStepCha nged(ByVal sender As Object, ByVal e As EventArgs)
        ' If the ActiveStep is changing to Step2 check to see if the
        ' CheckBox1 CheckBox is checked. If it is then skip
        ' to the Step3 step.

        If Wizard1.ActiveS tepIndex = 5 Then
        Wizard1.StepNex tButtonText = "Continue to step 5"
        End If
        End Sub

        Comment

        Working...