473,395 Members | 1,412 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.

Why CancelButton's OnClientClick cannot be set programmatically in a wizard?

Hi,

I'm trying to programmatically assign a script to a CancelButton's
OnClientClick in a wizard step. I'm doing it in ActiveStepChanged event
handler. I'm also assigning scripts to finish and previous buttons in the
same handler without any problems (btw, the same script is assigned to
previous and cancel buttons). When I view source on the client side I can
see onclick set to my scripts for finish and previous buttons but the cancel
button has no onclick property at all.

Assigning a script to OnClientClick declaratively (i.e. through IDE) works
fine.

Has anyone run into this problem?
I'd appreciate _any_ suggestions.

Thanks,
Bogdan
Jun 27 '08 #1
1 2417
I figured out what the problem was. I was setting onclick on a different
cancel button that I was supposed to. I was getting references to finish
and previous buttons by calling FindControl(id, Page.Controls). That worked
fine for previous and finish buttons because they had unique ids (i.e.
"FinishPreviousButton" and "FinishButton"). I then (few weeks later) tried
to use the same code to reference the cancel button. I forgot that the
cancel button on the finish page had the same id (i.e. "CancelButton") as on
the other page.

Bogdan
"Bogdan" <bo****@company.comwrote in message
news:uG**************@TK2MSFTNGP04.phx.gbl...
Hi,

I'm trying to programmatically assign a script to a CancelButton's
OnClientClick in a wizard step. I'm doing it in ActiveStepChanged event
handler. I'm also assigning scripts to finish and previous buttons in the
same handler without any problems (btw, the same script is assigned to
previous and cancel buttons). When I view source on the client side I
can see onclick set to my scripts for finish and previous buttons but the
cancel button has no onclick property at all.

Assigning a script to OnClientClick declaratively (i.e. through IDE) works
fine.

Has anyone run into this problem?
I'd appreciate _any_ suggestions.

Thanks,
Bogdan


Jun 27 '08 #2

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

Similar topics

6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
5
by: Oenone | last post by:
I have a VB.NET form which I'm displaying modally using the ShowDialog() method. Within the form is a Cancel button, and I've set this button into the Form's CancelButton property so that...
2
by: Martin Widmer | last post by:
Hi guys I am looking for the best way to generate new reports with reporting services for SQL server 2005. The reports will be generated programmatically from a .Net VB application. So far I see...
8
by: Terry | last post by:
I have noiticed a change in behavior between VB6 and VB.Net (2003 and 2005) that I don't find documented anywhere. It has to do with 'causesvalidation' and the button on the Form defined to be the...
0
by: jtencate | last post by:
I am trying to add an OnClientClick event to links in an asp:Menu. I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton with an OnClientClick attribute. This works fine to...
3
by: Josh Kodroff | last post by:
I have a pretty standard Windows Form with 2 relevant buttons: btnOK and btnCancel. I set both buttons' DialogResult properties appropriately. I then set the form AcceptButton and CancelButton...
0
by: Michel Couche | last post by:
Hello, I would like to programmatically set the visibility of a selectedWizardStep after clicking on a button contained in an other one. I found the following in an article from D. Esposito...
0
by: Sully | last post by:
Hi Guys, I have this about 98% done and I cannot get it work properly. I have a Repeater bound to a MySQL DataSource, inside the Repeater I have an ImageButton, outside the repeater I have a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
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
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...

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.