PC Review


Reply
Thread Tools Rate Thread

Changing Next button text for wizard step.

 
 
M. Ali Qureshi
Guest
Posts: n/a
 
      3rd Jan 2008
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 = "<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
 
 
 
 
oroussea@gmail.com
Guest
Posts: n/a
 
      3rd Jan 2008
On Jan 3, 9:51*am, "M. Ali Qureshi" <m.ali.qure...@hotmail.com> 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 = "<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...uttontext.aspx
 
Reply With Quote
 
M. Ali Qureshi
Guest
Posts: n/a
 
      3rd Jan 2008
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?



<(E-Mail Removed)> wrote in message
news:06b80aa2-1cd7-416a-9c23-(E-Mail Removed)...
On Jan 3, 9:51 am, "M. Ali Qureshi" <m.ali.qure...@hotmail.com> 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 = "<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...uttontext.aspx

 
Reply With Quote
 
oroussea@gmail.com
Guest
Posts: n/a
 
      4th Jan 2008
Yeah... you could handle the OnActiveStepChanged event like this:

<asp:Wizard ID="Wizard1" Runat="server"
OnActiveStepChanged="OnActiveStepChanged"></asp:Wizard>

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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Text Import Wizard Defaults Cm~ Microsoft Excel Discussion 2 19th Dec 2009 01:35 AM
Import text wizard, Advanced button pgarcia Microsoft Access External Data 1 16th Jan 2009 08:17 PM
Ajax, changing text in a button, and button click problem Tim Microsoft ASP .NET 0 23rd Jul 2008 08:57 PM
Text Import Wizard, Step 3 (converting .tsv file to Excel) =?Utf-8?B?RXZl?= Microsoft Excel Worksheet Functions 2 21st Jul 2007 04:06 PM
Setting the Form DefaultButton to a wizard Step Button (2.0) John Mott Microsoft ASP .NET 3 19th Dec 2006 10:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:01 AM.