Call an event handler programatically

G

Guest

Hi,

I have an asp button name btnSubmit in a web form

Here is the event handler declaration:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click

How can I call this sub programatically? Of course I can just insert one
line of code with the Sub name, but what sender and e should I use?

TIA
 
L

Lucas Tam

Hi,

I have an asp button name btnSubmit in a web form

Here is the event handler declaration:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click

How can I call this sub programatically? Of course I can just insert one
line of code with the Sub name, but what sender and e should I use?


You can use "nothing"

btnsubmit_click(nothing, nothing)
 
G

Guest

how about instead you put in a function in the btn event that you call, then
you can call that function from anywhere, anytime.... without worrying about
the button's events.
 

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
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top