Firing an asp:button, from the c# code, not from the form

Discussion in 'ASP .Net' started by foldface@yahoo.co.uk, Feb 26, 2004.

  1. Guest

    Hi
    As the subject says. I have a webpage with a button (amongest other
    things). I want press the button from the code and hence initiate a postback

    Thanks
    F
     
    , Feb 26, 2004
    #1
    1. Advertising

  2. Hello mate

    why do you want to do this? What are you trying to achieve? There might be a better solution

    Jon
     
    =?Utf-8?B?Sm9u?=, Feb 26, 2004
    #2
    1. Advertising

  3. Hi, F,

    How about calling directly the handler:

    Button1_Click(Buton1, EventArgs.Empty);

    Greetings
    Martin
    <> wrote in message
    news:...
    > Hi
    > As the subject says. I have a webpage with a button (amongest other
    > things). I want press the button from the code and hence initiate a

    postback
    >
    > Thanks
    > F
     
    Martin Dechev, Feb 26, 2004
    #3
  4. Z D Guest

    just directly call the function that handles the button click event. Dont
    worry about the parameters that you pass in for sender and eventargs.

    OR

    have the function that handles the click event call another function, then,
    from code, call this new function.




    <> wrote in message
    news:...
    > Hi
    > As the subject says. I have a webpage with a button (amongest other
    > things). I want press the button from the code and hence initiate a

    postback
    >
    > Thanks
    > F
     
    Z D, Feb 26, 2004
    #4
    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. Eric Sabine

    code on button not firing on click

    Eric Sabine, Jun 3, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    339
    Janaka
    Jun 3, 2004
  2. ~~~ .NET Ed ~~~
    Replies:
    3
    Views:
    15,184
    nizarbabu
    Sep 8, 2008
  3. csgraham74

    asp:button control not firing event

    csgraham74, Sep 10, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    4,019
    csgraham74
    Sep 10, 2005
  4. csgraham74

    asp:button event not firing

    csgraham74, Sep 11, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    10,532
    csgraham74
    Sep 17, 2005
  5. Replies:
    3
    Views:
    1,520
Loading...

Share This Page