473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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_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.

Jan 3 '08 #1
3 6853
On Jan 3, 9:51*am, "M. Ali Qureshi" <m.ali.qure...@hotmail.comwrote:
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...uttontext.aspx
Jan 3 '08 #2
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?

<or******@gmail.comwrote in message
news:06**********************************@p68g2000 hsd.googlegroups.com...
On Jan 3, 9:51 am, "M. Ali Qureshi" <m.ali.qure...@hotmail.comwrote:
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...uttontext.aspx

Jan 3 '08 #3
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
Jan 4 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Aylott | last post by:
Greetings When I use the import text wizard with a fixed width text file, I add a break at the correct column but it doesn't line up with the text. It seems that the display is shown in a...
2
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
2
by: Vear | last post by:
Hi I have created a couple of CreateUserSteps infront of the default one. I use control validators for most of the fields but in the State drop down list I want to make sure the user has chosed...
1
by: MOUSTAFA ARAFA | last post by:
Dear All, i want to hide next button programatically in weizard control,i tried the find control function,but it deosnt work ? can anyone help me on that ?
0
by: sudhashekhar30 | last post by:
hi everybody. i want to add javascript function to next button of wizard control. how to access next button. like wizard1.attributes.add("OnNextButtonClick","JSFunction()"); please reply....
8
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
I am working with Visual C# window and in my application I need to use a button ( NEXT) . The button should displays one panel with its objects each time it clicked. I already developed the codes...
0
by: Ignacio Machin ( .NET/ C# MVP ) | last post by:
On Apr 22, 2:51 pm, Tammy Nejadian <TammyNejad...@discussions.microsoft.comwrote: Do a search in the archives of this NG, look for "wizard" you will find a lot of examples
1
by: Andy B | last post by:
I have a wizard with multiple steps in it. On the first step, I have a gridView that shows the users current input for that particular step. The GridView is bound to an in memory object. When I...
1
by: Jim in Arizona | last post by:
using ASP.NET/VB.NET 2.0 I can change the text color of an ASP Button object on mouse rollover/rollout by doing this (in page_load) btnMyButton.Attributes.Add("onmouseover",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.