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

B

Bogdan

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
 
B

Bogdan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,732
Latest member
ArronPalin

Latest Threads

Top