Simulation of Button click

M

mg

I have a WebForm with C# and JavaScript functions -

The aspx file holds two buttons: Button1 and Button2

In Page_Load (code behind), I have Button2.Attributes.Add
("onclick", "func()");

My program works if I first press Button1 with the mouse
and then press Button2 with the mouse.

I'd like to run the same program by physically pressing
only Button1.

I'd like the code in the event handler of Button1 to run
first, then have the (programatic) pressing of Button2
cause the JavaScript function func() to run as a result
of the Button2 "onclick" event.
 
T

Tommy

It will be helpful if you could explain your processing flow in greater detail.

1. Are button1 and button2 web controls or html controls?
2. Does button1 and button2 fire server-side event or only client-side event.
3. Why do you need to press button2 to call a javascript function?
Why can't you just call the javascript function directly?

Tommy,
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top