473,503 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling function from onclick

Sorry if this is the wrong newsgroup in which to post.

We have an asp page on a webserver supporting asp pages.

How can we run/call a function on this page using an onclick or other event
from a control. For example, when an image is clicked or a combobox is
changed. We know how to run a javascript, but would be nice to run an asp
function.

Thanks.
Jul 22 '05 #1
3 12586
Curtis wrote on 20 nov 2004 in microsoft.public.inetserver.asp.general:
Sorry if this is the wrong newsgroup in which to post.

We have an asp page on a webserver supporting asp pages.

How can we run/call a function on this page using an onclick or other
event from a control. For example, when an image is clicked or a
combobox is changed. We know how to run a javascript, but would be
nice to run an asp function.


Impossible!

ASP runs on the server BEFORE the page is submitted to the client.

The only way to execute a server function [that btw can be written in
javascript] is to send a request [for a new/same page] to the server.

========== test.asp ===========

<script runat=server language=javascript>
response.write( request.querystring('x') );
</script>

<br>
<button onclick="location.href='test.asp?x=Hello%20world'" >
Write 'Hello world' above this button
</button>

================================

ASP is not a language but a server platform for script languages,
like j[ava]script and vbscript.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 22 '05 #2
I use the following code in my clientside JavaScript to make calls back to the server.
I call asp pages with querystring data.
This allows me to save, retrieve, and delete data without submitting the page.

function ProcessURL(strURL) {
var XMLHTTP;
var strResult;
document.body.style.cursor='wait';
XMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
XMLHTTP.open( "GET", strURL, false );
XMLHTTP.send();
document.body.style.cursor='auto';
}

--
'dlbjr
'Pleading sagacious indoctrination!
Jul 22 '05 #3
you could also use remote scripting. just search www.msdn.com

"dlbjr" <oo**@iforgot.com> wrote in message
news:uy**************@TK2MSFTNGP11.phx.gbl...
I use the following code in my clientside JavaScript to make calls back to
the server.
I call asp pages with querystring data.
This allows me to save, retrieve, and delete data without submitting the
page.

function ProcessURL(strURL) {
var XMLHTTP;
var strResult;
document.body.style.cursor='wait';
XMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
XMLHTTP.open( "GET", strURL, false );
XMLHTTP.send();
document.body.style.cursor='auto';
}

--
'dlbjr
'Pleading sagacious indoctrination!

Jul 22 '05 #4

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

Similar topics

10
7485
by: R.G. Vervoort | last post by:
I am using a javafunction (onclick in select) in which i am calling a function in php (thats why i send this to both php and javascript newsgroups). in the onclick i call the function...
5
9054
by: Ãéþñãïò ÓôÜèçò | last post by:
Well I'm a newbie in ASP but still I can't understand the reason to get an error message when I click on the button. The following code is supposed to display a message when pressing the button? ...
2
2744
by: bbxrider | last post by:
i'm trying to pass a form object to a function to validate the forms user input when i try to access a forms properties-like .elements there is no response from the function and no error msg, i...
1
4309
by: Christian Radermacher | last post by:
Hi, the following code has the mentioned behaviour: <html> <head> <script type="text/javascript"> function newA() { for (i=0;i<3;i++) { var a = window.frames.document.createElement("a");
7
2457
by: meaneyedcat | last post by:
When I call addField(), my table appears to be populated correctly with a new row in the table with all the required fields. However, when I call delete row on any new rows that have been created,...
4
1743
by: Miguel Dias Moura | last post by:
Hi, I just uploaded a web site and i am getting an error. I have a script which sends form values to an email using AspNetEmail. The script was working when i was calling the script like...
1
1495
by: evanburen | last post by:
When I click on the "Check All" checkbox, it correctly checks all of the boxes in my form, but I would like each checkbox to also call hideLayer2 function just as what would occur if the user...
3
1947
by: phish.guy | last post by:
How do I call another event's onclick function from a button press? I have stored information dynamically created in a div onclick function that is not accessible directly by the button, but i...
5
2023
by: IchBin | last post by:
Not sure if I should post this to a javascript group or here. So I'll try here first since most here mix both in this group. I am trying to pass a php value into a JavaScript function that changes...
13
7762
by: Steve | last post by:
On page 392 of "Javascript the definitive guide" a function is called like this:- <form action="processform.cgi" onsubmit="return validateForm();"> Why, in this instance, is the return...
0
7203
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,...
0
7282
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,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
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...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
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...
0
1515
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 ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
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...

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.