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

F

foldface

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
 
G

Guest

Hello mate

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

Jon
 
M

Martin Dechev

Hi, F,

How about calling directly the handler:

Button1_Click(Buton1, EventArgs.Empty);

Greetings
Martin
 
Z

Z D

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top