locked
How to raise button click event? RRS feed

  • Question

  • I have a web based form.  I would like to simulate button click on the code behind.  Any suggestion? Thanks.
    Monday, October 24, 2011 4:07 PM

Answers

  • Hi lcha,

    If you just only want to trigger the btn_clicked function, you can call like this btn_clicked(this, null), but this will not use the sender and e of that button associated with.

    Thanks


    Regards, Daniel
    Wednesday, October 26, 2011 8:53 AM
    Moderator

All replies

  • I tried to call this function:

     

    btn_Clicked(object sender, ClickedEventArgs e)

    I used btn_clicked(null, null).  I got null value exception.

     

     

    Monday, October 24, 2011 4:12 PM
  • Hi lcha,

    If you just only want to trigger the btn_clicked function, you can call like this btn_clicked(this, null), but this will not use the sender and e of that button associated with.

    Thanks


    Regards, Daniel
    Wednesday, October 26, 2011 8:53 AM
    Moderator