Changing Next button text for wizard step.

Changing Next button text for wizard step.

am 03.01.2008 15:51:07 von m.ali.qureshi

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_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles HitRaterWiz.Init
Dim CatAdapter As New
HitRaterTableAdapters.QuestionCategoriesTableAdapter()
Dim DataTable As HitRater.QuestionCategoriesDataTable =
CatAdapter.GetData()
Dim row As HitRater.QuestionCategoriesRow
Dim Counter As Integer = 1
For Each row In DataTable
Dim CatStep As New WizardStep
CatStep.AllowReturn = True
Dim CatHeading As New Literal
CatHeading.Text = "

" &
row.QuestionCategory.ToString() & "
"
CatStep.Controls.AddAt(0, CatHeading)
CatStep.Controls.AddAt(1,
GetQuestionsTable(row.QuestionCategoryID))
HitRaterWiz.WizardSteps.Add(CatStep)
Counter += 1
Next
End Sub
==============================

Thanks for help.

Rgds.

Re: Changing Next button text for wizard step.

am 03.01.2008 17:51:32 von oroussea

On Jan 3, 9:51=A0am, "M. Ali Qureshi" wrote:
> 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". B=
ut
> 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:
>
> ==================== =====
======
> =A0 =A0 Protected Sub HitRaterWiz_Init(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles HitRaterWiz.Init
> =A0 =A0 =A0 =A0 Dim CatAdapter As New
> HitRaterTableAdapters.QuestionCategoriesTableAdapter()
> =A0 =A0 =A0 =A0 Dim DataTable As HitRater.QuestionCategoriesDataTable =3D
> CatAdapter.GetData()
> =A0 =A0 =A0 =A0 Dim row As HitRater.QuestionCategoriesRow
> =A0 =A0 =A0 =A0 Dim Counter As Integer =3D 1
> =A0 =A0 =A0 =A0 For Each row In DataTable
> =A0 =A0 =A0 =A0 =A0 =A0 Dim CatStep As New WizardStep
> =A0 =A0 =A0 =A0 =A0 =A0 CatStep.AllowReturn =3D True
> =A0 =A0 =A0 =A0 =A0 =A0 Dim CatHeading As New Literal
> =A0 =A0 =A0 =A0 =A0 =A0 CatHeading.Text =3D "

"=
&
> row.QuestionCategory.ToString() & "
"
> =A0 =A0 =A0 =A0 =A0 =A0 CatStep.Controls.AddAt(0, CatHeading)
> =A0 =A0 =A0 =A0 =A0 =A0 CatStep.Controls.AddAt(1,
> GetQuestionsTable(row.QuestionCategoryID))
> =A0 =A0 =A0 =A0 =A0 =A0 HitRaterWiz.WizardSteps.Add(CatStep)
> =A0 =A0 =A0 =A0 =A0 =A0 Counter +=3D 1
> =A0 =A0 =A0 =A0 Next
> =A0 =A0 End Sub
> ==================== =====
======
>
> Thanks for help.
>
> Rgds.

Have you tried changing stepNextButtonText depending on the current
step?

http://msdn2.microsoft.com/en-us/library/system.web.ui.webco ntrols.wizard.st=
epnextbuttontext.aspx

Re: Changing Next button text for wizard step.

am 03.01.2008 19:10:18 von m.ali.qureshi

Hi,

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

===========================
Protected Sub Wizard1_Init(ByVal sender As Object, ByVal e As
System.EventArgs) 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.Controls.AddAt(0, CatLabel)
If i = 4 Then
Wizard1.StepNextButtonText = "Go to next step"
Else
Wizard1.StepNextButtonText = "Next"
End If
Wizard1.WizardSteps.Add(CatStep)
Next
End Sub
==========================

Any idea?



wrote in message
news:06b80aa2-1cd7-416a-9c23-4c56c159a2f0@p68g2000hsd.google groups.com...
On Jan 3, 9:51 am, "M. Ali Qureshi" wrote:
> 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_Init(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles HitRaterWiz.Init
> Dim CatAdapter As New
> HitRaterTableAdapters.QuestionCategoriesTableAdapter()
> Dim DataTable As HitRater.QuestionCategoriesDataTable =
> CatAdapter.GetData()
> Dim row As HitRater.QuestionCategoriesRow
> Dim Counter As Integer = 1
> For Each row In DataTable
> Dim CatStep As New WizardStep
> CatStep.AllowReturn = True
> Dim CatHeading As New Literal
> CatHeading.Text = "

" &
> row.QuestionCategory.ToString() & "
"
> CatStep.Controls.AddAt(0, CatHeading)
> CatStep.Controls.AddAt(1,
> GetQuestionsTable(row.QuestionCategoryID))
> HitRaterWiz.WizardSteps.Add(CatStep)
> Counter += 1
> Next
> End Sub
> ==============================
>
> Thanks for help.
>
> Rgds.

Have you tried changing stepNextButtonText depending on the current
step?

http://msdn2.microsoft.com/en-us/library/system.web.ui.webco ntrols.wizard.stepnextbuttontext.aspx

Re: Changing Next button text for wizard step.

am 04.01.2008 23:46:22 von oroussea

Yeah... you could handle the OnActiveStepChanged event like this:

OnActiveStepChanged="OnActiveStepChanged">

Sub OnActiveStepChanged(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.ActiveStepIndex = 5 Then
Wizard1.StepNextButtonText = "Continue to step 5"
End If
End Sub