Checking which button is clicked on page_load..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rupali12345
    New Member
    • Jun 2007
    • 13

    Checking which button is clicked on page_load..

    Hi all,

    I want to do different functionalities on two button click events.
    I Added code

    Button1.Attribu tes.Add("onClic k","Showpre()") ;---line1
    Button2.Attribu tes.Add("onClic k","Showresp()" );---line2

    on page_load.

    Even if I am clicking button2, line1 is executed...

    I want to check which button is clicked on page load..and call the functions respectively..


    plz help..
    -
    Rupali
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi Rupali,

    Are you saying that you want to add the client side OnClick event to the button only if it has already been clicked? If so use the buttons server side Click event to add the attribute rather than the Page_Load event.

    Dr B

    Comment

    • Murugs
      New Member
      • Nov 2007
      • 18

      #3
      Hi,
      Can you add more details abt ur requirement so that we can give better solution.
      You can able to find which button clicked in page load using request event argument.
      You first need to send the event argument from javascript and then accessing it from server side.

      Thanks,
      Murugs.

      Comment

      Working...