Home All Groups Group Topic Archive Search About
Author
18 Jan 2006 6:02 PM
Bahman
Hello!

I need an asp button to run multiple onclick events.

First, it needs to run a piece of javascript.

Next, it needs to run its own procedure (button_Click...).

I may need to do other things.

What is the best way to do this?

Is there a way to call the onclick event more than once?

Thank you!

-Bahman

Author
18 Jan 2006 6:45 PM
Bahman
Hi Again!

After reading mile-long documentation on how to do this, I did this:

I created two controls; one aspnet and one regular html. I gave both the
same name and hid the aspnet one. I wrote the onclick for the html in
javascript and the onclick for the aspnet in c#.

It works.

It would be nice if the control was a bit more 'integrated'.

Thank you! Happy Wednesday!

-Bahman

Show quoteHide quote
"Bahman" wrote:

> Hello!
>
> I need an asp button to run multiple onclick events.
>
> First, it needs to run a piece of javascript.
>
> Next, it needs to run its own procedure (button_Click...).
>
> I may need to do other things.
>
> What is the best way to do this?
>
> Is there a way to call the onclick event more than once?
>
> Thank you!
>
> -Bahman
Author
19 Jan 2006 6:53 PM
Doug Salomon
The button controls for asp.net 2.0 have a "OnClientClick" property, which
can be used for that purpose, I beleive.

(I don't recall, offhand, if this was available in the previous versions of
..net).

Doug

Show quoteHide quote
"Bahman" wrote:

> Hi Again!
>
> After reading mile-long documentation on how to do this, I did this:
>
> I created two controls; one aspnet and one regular html. I gave both the
> same name and hid the aspnet one. I wrote the onclick for the html in
> javascript and the onclick for the aspnet in c#.
>
> It works.
>
> It would be nice if the control was a bit more 'integrated'.
>
> Thank you! Happy Wednesday!
>
> -Bahman
>
> "Bahman" wrote:
>
> > Hello!
> >
> > I need an asp button to run multiple onclick events.
> >
> > First, it needs to run a piece of javascript.
> >
> > Next, it needs to run its own procedure (button_Click...).
> >
> > I may need to do other things.
> >
> > What is the best way to do this?
> >
> > Is there a way to call the onclick event more than once?
> >
> > Thank you!
> >
> > -Bahman