By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,905 Members | 2,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,905 IT Pros & Developers. It's quick & easy.

calling function from onclick

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.