Calling server side sub routine from javascript

J

Jimbo

I want a server side sub routine to be called depending on the result
of a javascript confirm box..It probably cant be done..but I thought Id
ask..heres the code snippet..thanks Jim

<%
if compare() = false then
%>
<script runat="server" language="javascript" >
var answer = confirm ("Changes have been made, would you like to
save?");
if (answer==true)
{
<%
Call saveMedicalInfo
%>
}
</script>
<%
end if
%>
 
S

Slim

Jimbo said:
I want a server side sub routine to be called depending on the result
of a javascript confirm box..It probably cant be done..but I thought Id
ask..heres the code snippet..thanks Jim

there is 2 ways i know

first
you can use this trick

var fakeImage = new Image()
fakeImage.scr = "aASPpage.asp?var1=5&var2=Hay"

in the above code you have loaded a asp page with rendering it to screen,
you have also passed 2 variables to it


or you can use the xmlHTTP object
http://support.microsoft.com/kb/290591
 
B

Bob Barrows [MVP]

Slim said:
there is 2 ways i know

first
you can use this trick

var fakeImage = new Image()
fakeImage.scr = "aASPpage.asp?var1=5&var2=Hay"

"scr" should be "src"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top