473,246 Members | 1,389 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,246 software developers and data experts.

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 12570
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
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
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
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
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
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
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
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
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
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
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
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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...

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.