473,569 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call the function - simulation

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 page Unloads:

<script lang="JavaScrip t">
function OnUnLoad(){
alert("You want to leave this page,
pleaes save your data first!");
var userInput = confirm("Do you wish to
save the data modified on this page?");
if (userInput==tru e)
{
alert("The data is saved")
}
else
{
alert("All latest
modifications are lost")
}
}
</script>
</HEAD>

<body scroll="yes" onload="Refresh Tray()" MS_POSITIONING= "GridLayout "
onunload='OnUnL oad()'>

I also have a button on this page allowing me to save the data and the
implementation is written in C# in the code behind. Can I simulate this
button clicking inside this JavaScript and how? Or this idea is basically
wrong and I need to do anything else? What exectly? Any idea?

Thanks,
Just D.
Nov 20 '05 #1
1 1072
you can just do

document.forms[0].submit();

note: no server side button event will fire. you can call the button click

document.getEle mentById("butto nid").onclick() ;

-- bruce (sqlwork.com)

"Just D." <no@spam.please > wrote in message
news:Xxpff.396$ 4v.72@fed1read0 3...
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 page Unloads:

<script lang="JavaScrip t">
function OnUnLoad(){
alert("You want to leave this page,
pleaes save your data first!");
var userInput = confirm("Do you wish to
save the data modified on this page?");
if (userInput==tru e)
{
alert("The data is saved")
}
else
{
alert("All latest
modifications are lost")
}
}
</script>
</HEAD>

<body scroll="yes" onload="Refresh Tray()" MS_POSITIONING= "GridLayout "
onunload='OnUnL oad()'>

I also have a button on this page allowing me to save the data and the
implementation is written in C# in the code behind. Can I simulate this
button clicking inside this JavaScript and how? Or this idea is basically
wrong and I need to do anything else? What exectly? Any idea?

Thanks,
Just D.

Nov 20 '05 #2

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

Similar topics

1
3184
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 find are online space trading or role-playing style games, rather than any kind of "tycoon" or "civilisation" style games written in PHP.
0
2008
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
1723
by: Gitesh | last post by:
..................... CALL FOR PAPERS ..................... The 2004 International Multiconference in Computer Science and Computer Engineering (18 Joint Int'l Conferences) http://www.world-academy-of-science.org Monte Carlo Resort, Las Vegas, Nevada, USA June 21-24, 2004
0
2375
by: Constandinos Mavromoustakis | last post by:
http://agent.csd.auth.gr/~cmavrom -------------------------------------------------- ============================================================================ = 37th Annual Simulation Symposium April 18 - 22, 2004 Hyatt Regency Crystal City
19
7148
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 discrete event simulation, but I haven't found any work about continuous system. I would like to develop a generic continous system simulator, and so...
0
1766
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 Multiconference San Diego, April 2-8, 2005 Hilton Mission Valley Hotel
19
17495
by: Riko Wichmann | last post by:
hi everyone, I'm googeling since some time, but can't find an answer - maybe because the answer is 'No!'. Can I call a function in python inline, so that the python byte compiler does actually call the function, but sort of inserts it where the inline call is made? Therefore avoiding the function all overhead. Thanks and cheers,
1
2672
by: Tim Silva | last post by:
SDX Modeling, Simulation and Numerical Computing Environment for science and engineering has now been released. Major features include: * A unified simulation environment for modeling virtually any type of continuous-time (ode), discrete-time (digital), hybrid or multi-rate dynamic system. * A flexible "open system" architecture that...
4
2770
by: Richard Blackwood | last post by:
Hello all. I have a few questions about simulation programming. One, do all programmers know to how to code a simulation? By simulation I mean a model of real world relationships (i.e. like Civilization which is a simulation of ruling nations through various historical settings). For example, could someone who codes word processing application...
22
4166
by: Nehil | last post by:
Does C follow call by value convention or call by reference? i see that there is nothing like reference in C standard but it is referenced. still, what should be the answer for the above question?
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.