473,320 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Simulation of Button click

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.
Nov 18 '05 #1
2 1775
Perhaps this thread at ASP.NEt Forums gives you starters:
http://www.asp.net/Forums/ShowPost.a...&PostID=406072

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"mg" <mg@theworld.com> wrote in message
news:04****************************@phx.gbl...
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.

Nov 18 '05 #2
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,

"mg" <mg@theworld.com> wrote in message news:<04****************************@phx.gbl>...
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.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steaming Balturd | last post by:
are there any php based economic simulations out there - not trading games per se, but more like simulating an economy, be it running a business or running a government? All i've been able to...
0
by: Constandinos Mavromoustakis | last post by:
Dear all, first we apologize if you receive multiple copies of this announcement. please see below if you are interested. Thank you in advance....
0
by: Constandinos Mavromoustakis | last post by:
http://agent.csd.auth.gr/~cmavrom -------------------------------------------------- ============================================================================ = 37th Annual Simulation...
0
by: Gus | last post by:
---------------------------------------------------------------------------- ------------------------------------ Call for Papers: 38th Annual Simulation Symposium Part of the 2005 Spring...
19
by: Nicolas Pernetty | last post by:
Hello, I'm looking for any work/paper/ressource about continuous system simulation using Python or any similar object oriented languages (or even UML theory !). I'm aware of SimPy for...
0
by: Karatza Helen | last post by:
Our apologies if you have received multiple copies -------------------------------------------------- Call for Papers: 38th Annual Simulation Symposium Part of the 2005 Spring Simulation...
1
by: Just D. | last post by:
All, Does anybody know how can I simulate the button click from the JavaScript on ASPX page? Here is the fragment of the ASPX page with a simple JavaScript allowing me to do something before the...
12
by: whitehatmiracle | last post by:
Hello group I got the code of this classic elevator simulation. Im having some problem foloowing it. And i feel it can be simplified... can u people help me? here's the code: class button {...
5
by: ch13f | last post by:
The overall simulation should proceed as follows: A simulated clock is initialized to 0 and the repeatedly advanced by 1 minute until it is equal to some given time limit(minutes). On each "tick" of...
6
by: whitehatmiracle | last post by:
Hi all... Im getting some errors, and have no clue, as to what could be wrong... SOS... anybody ?? heres the code: // The elevator simulation //4 errors of 2 of same type //error, type...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.