HighTechTalks DotNet Forums  

Changing Next button text for wizard step.

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss Changing Next button text for wizard step. in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
M. Ali Qureshi
 
Posts: n/a

Default Changing Next button text for wizard step. - 01-03-2008 , 08:51 AM






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.QuestionCategoriesTableAdapt er()
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 = "<div class=""CatHeading"">" &
row.QuestionCategory.ToString() & "</div>"
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.


Reply With Quote
  #2  
Old   
oroussea@gmail.com
 
Posts: n/a

Default Re: Changing Next button text for wizard step. - 01-03-2008 , 10:51 AM






On Jan 3, 9:51*am, "M. Ali Qureshi" <m.ali.qure... (AT) hotmail (DOT) com> wrote:
Quote:
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.QuestionCategoriesTableAdapt er()
* * * * 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 = "<div class=""CatHeading"">"&
row.QuestionCategory.ToString() & "</div>"
* * * * * * 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/lib...tontex t.aspx


Reply With Quote
  #3  
Old   
M. Ali Qureshi
 
Posts: n/a

Default Re: Changing Next button text for wizard step. - 01-03-2008 , 12:10 PM



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?



<oroussea (AT) gmail (DOT) com> wrote

On Jan 3, 9:51 am, "M. Ali Qureshi" <m.ali.qure... (AT) hotmail (DOT) com> wrote:
Quote:
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.QuestionCategoriesTableAdapt er()
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 = "<div class=""CatHeading"">" &
row.QuestionCategory.ToString() & "</div>"
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/lib...tontex t.aspx



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.