Multiple onclick Events

Discussion in 'ASP .Net Web Controls' started by Bahman, Jan 18, 2006.

  1. Bahman

    Bahman Guest

    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
     
    Bahman, Jan 18, 2006
    #1
    1. Advertising

  2. Bahman

    Bahman Guest

    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
     
    Bahman, Jan 18, 2006
    #2
    1. Advertising

  3. Bahman

    Doug Salomon Guest

    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

    "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
     
    Doug Salomon, Jan 19, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel Hon
    Replies:
    4
    Views:
    7,834
    Samuel Hon
    Mar 6, 2004
  2. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    425
    Chris
    Aug 30, 2005
  3. DS
    Replies:
    2
    Views:
    201
    Bob Barrows
    Jan 7, 2004
  4. bob
    Replies:
    3
    Views:
    241
  5. Replies:
    2
    Views:
    285
Loading...

Share This Page