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

Calling server side sub routine from javascript

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
%>

Nov 16 '06 #1
2 4823

"Jimbo" <ji********@motorola.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
>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


>
<%
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
%>

Nov 16 '06 #2
Slim wrote:
"Jimbo" <ji********@motorola.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
>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"
"scr" should be "src"
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 16 '06 #3

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...
4
by: Ian Sedwell | last post by:
Hi guys I am writing a Javascript routine to check for the presence and version of an Adobe Acrobat PDFViewer on the user's machine. No problem with any browser on the Mac, no problem with any...
5
by: Krishna | last post by:
Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. Regards.., Krishna
1
by: C | last post by:
Hi, I have a server side asp.net button on a web page. On clicking the button I want to call some Javascript. Can I not simply do a onclick="MyJavascript();" or is it necessary that I add...
7
by: Roger | last post by:
Is this possible?? client side: <script language="jscript"> function hello() { window.alert("HELLO!"); } </script>
5
by: Jerry Camel | last post by:
Trying to implement the following: Users is logging in They enter theire username and password and click a login button The page should then display an activity indicator (animated gif) and then...
9
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
5
by: pbd22 | last post by:
Hi. I am trying to poll a long-running process via a hidden IFrame. I am noticing that the online errata gives advice for handling a server response: window.parent.handleServerResponse(); ...
7
by: =?Utf-8?B?am9uZWZlcg==?= | last post by:
I'm hoping this is a classic question, but the answer to it would help me with a lot of things. As you can see below, this code will never display the "Getting data...." text in the lblCheck -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.