473,379 Members | 1,539 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,379 software developers and data experts.

asp:Wizard control - hiding "next" button on certain steps.

Hi,

I'm using the asp:Wizard control and on some of the steps, I would only
like the user to be able to progess to the next step by clicking an
image button. Therefore I would like to be able to hide the Next button
on these steps.

Is there any way to do this?

I know you can convert the navigation to a template, but this is a
common template for all steps rather than a template for a particular step.

Thanks,

Nick...
Dec 12 '06 #1
5 21687
Hi Nick,

You can use following steps to hide or show each step's next/prev button:

1) Add following CSS rules to your ASPX:

<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.hidden { display: none; }
.visible { display: inline; }
</style>
</head>
You can find more information about CSS display here:

#CSS2 - The display declaration
http://www.quirksmode.org/css/display.html


2) Handle the Wizard's ActiveStepChanged event:

protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex == 1)
{
Wizard1.StepNextButtonStyle.CssClass = "hidden";
}
else
{
Wizard1.StepPreviousButtonStyle.CssClass = "visible";
Wizard1.StepNextButtonStyle.CssClass = "visible";
}
}
Hope this helps.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 13 '06 #2
Thanks Walter. I hadn't thought of doing that. It's a shame you can't
have per-step templates because this solution seems a bit of a hack to
me. It would be nicer if you could set which buttons appear in each step
in the step declaration or a template inside the step.

I have since had another idea which I might use:
I can simply hide the buttons completely by using an empty template then
add back in the buttons I need manually in the WizardStep template. I
can then change the active step in the onclick handler for those buttons.

Thanks,

Nick...
Dec 15 '06 #3
Actually, this turns out to be much easier than I thought.

If you want to customise when the next and previous buttons appear you
just need to do the following:

1. In design view, select "convert to StepNavigationTemplate" on the Wizard.
2. Copy the next and previous buttons into the templates for the steps
that require them. (the only important thing is that the CommandName is
either MoveNext or MovePrevious.

3. Delete the contents of the StepNavigationTemplate to avoid duplicate
buttons:

<StepNavigationTemplate></StepNavigationTemplate>

Done! The buttons work automatically with no additional code as the
Wizard control just seems to check the CommandName on postback.

This means you can use LinkButtons or ImageButtons too in the same way
as long as the commandname is the same.

Nick...
Walter Wang [MSFT] wrote:
Hi Nick,

You can use following steps to hide or show each step's next/prev button:

1) Add following CSS rules to your ASPX:

<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.hidden { display: none; }
.visible { display: inline; }
</style>
</head>
You can find more information about CSS display here:

#CSS2 - The display declaration
http://www.quirksmode.org/css/display.html


2) Handle the Wizard's ActiveStepChanged event:

protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex == 1)
{
Wizard1.StepNextButtonStyle.CssClass = "hidden";
}
else
{
Wizard1.StepPreviousButtonStyle.CssClass = "visible";
Wizard1.StepNextButtonStyle.CssClass = "visible";
}
}
Hope this helps.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Dec 15 '06 #4
Hi Nick,

Thank you for sharing your solution. You're right that it's the CommandName
of a control that supports bubbling event controls Next or Previous step.
By removing the default StepNavigationTemplate content and using
CommandName, you have full control of how to show the navigation controls.
For more information about event bubbling:

#Bubbling an Event
http://msdn2.microsoft.com/en-gb/lib...44(VS.71).aspx

#Control.RaiseBubbleEvent Method (System.Web.UI)
http://msdn2.microsoft.com/en-us/lib....raisebubbleev
ent.aspx

#Event Bubbling Control Sample
http://msdn2.microsoft.com/en-gb/lib...44(VS.71).aspx
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 18 '06 #5
Hi

Please give some working code on how to access the next and previous
buttons. In which event I will write the code

Thanks

Arun

On Dec 15 2006, 8:10 pm, Nick Gilbert <n...@newsgroup.nospamwrote:
Actually, this turns out to be much easier than I thought.

If you want to customise when thenextand previous buttons appear you
just need to do the following:

1. In design view, select "convert to StepNavigationTemplate" on theWizard.
2. Copy thenextand previous buttons into the templates for the steps
that require them. (the only important thing is that the CommandName is
either MoveNext or MovePrevious.

3. Delete the contents of the StepNavigationTemplate to avoid duplicate
buttons:

<StepNavigationTemplate></StepNavigationTemplate>

Done! The buttons work automatically with no additional code as theWizardcontroljust seems to check the CommandName on postback.

This means you can use LinkButtons or ImageButtons too in the same way
as long as the commandname is the same.

Nick...

Walter Wang [MSFT] wrote:
Hi Nick,
You can use following steps to hide or show each step'snext/prevbutton:
1) Add following CSS rules to your ASPX:
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.hidden { display: none; }
.visible { display: inline; }
</style>
</head>
You can find more information about CSS display here:
#CSS2 - The display declaration
http://www.quirksmode.org/css/display.html
2) Handle theWizard'sActiveStepChanged event:
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex == 1)
{
Wizard1.StepNextButtonStyle.CssClass = "hidden";
}
else
{
Wizard1.StepPreviousButtonStyle.CssClass = "visible";
Wizard1.StepNextButtonStyle.CssClass = "visible";
}
}
Hope this helps.
Sincerely,
Walter Wang (waw...@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ps/default.asp...
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.- Hide quoted text -- Show quoted text -
Jan 24 '07 #6

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

Similar topics

11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
2
by: Assaf | last post by:
Hi, I added to my setup project TextBox dialog control which contains two textbox. I want to add the ability to disable the next button until the user enter some text in the textbox (let's say...
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 ?
12
by: raghav | last post by:
Hi I am working on ASP.NET 2.0. I am developing a website using Wizard control. Based on number of steps added, next, previous, finish buttons generate automatically. After running the...
0
by: raghav | last post by:
Hi I am working on ASP.NET 2.0. I am developing a website using Wizard control. Based on number of steps added, next, previous, finish buttons generate automatically. After running the...
3
by: karen987 | last post by:
Can someone please explain what code i need to add to keep a set of links at the bottom of a pop up window? I need it in a page where people post comments. It is a pop up window, of about 500x400...
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....
3
by: M. Ali Qureshi | last post by:
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...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.