Hello,
With ASP.NET2, how to program a button's click ?
For example, I have two button and when i click the first one, i would like
that the second one will be click too (by programming) ... something like
button2.click ???
Thanks for help ..
There is no real way to have both buttons pushed however you can
program it so that when button 1 is pressed they get the same results
that happen with button 2.
Presuming you are in visual studio or the web express version and want
to do the code on the server end you do the following, if you want to
do this all on the client end you will need to do it using ecmascript
aka javascript and that would be better asked in another group;
however the general idea would be the same.
As for on the server side go into the design view and drag a button to
the screen and double click on the first button, this will generate
the code framework needed to handle the button.
Now you will need to write the code you want to execute, do what you
want for each button in a separate function then in the area for
button 1 call both of those functions. Then go back and drag button 2
where you want it and double click and call the function for button 2
in that place. If you want both buttons to do the same thing then
just write one function and have both button events call it.