Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
I created a classic ASP page. I capture some data from the 3rd party application using java script. Here I want to store that data into the sql database. After press a button all the values should store in the database. But I can't understand how to do it. Appreciate if any one can help me.
Here is my asp page.
<title>Test of disconnection</title>
<meta http-equiv="Content-Language" content="<%=language%>">
<meta http-equiv="Content-Type" content="<%=charset%>">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
<style type="text/css">
    * { margin:0; padding:0; }
    h1 {
	font-family: "Trebuchet MS", sans-serif;
	font-size: 1.8em;
	letter-spacing: -1px;
	background-color: #3f5f91;
	color: white;
	padding: 7px;
	margin-bottom: 7px;
<body onLoad="connectExternal(); startClock();" bgcolor="#ffffff">
<div id="connected" style="display:none;">
<h1 style="color: #afa" >Call connected</h1>
<div id="QueueName" style="display:None;">
<h1 style="color: #afa"> OK </h1>
<div id="disconnected" style="display:none;">
<h1 style="color: #faa">Call disconnected!</h1>
<input type=submit name="Submit" value="Submit" onclick="--Save Record in Database--"></input>
<div id="noconnection" style="display:none;">
<h1 style="color: #ffa">Opened not in Client, will not work</h1>

<script type="text/javascript" language="JavaScript">
var ActivePhoneCall;
var QueueName;
var LogonName = "<%=Server.URLEncode(Request.ServerVariables("LOGON_USER"))%>";
var handler = function(a1, a2, a3) {
function connectExternal() {
  try {
    ActivePhoneCall = window.external.GetActivePhoneCall();
    if (ActivePhoneCall.CallState != 3) 
      document.getElementById("connected").style.display = 'block';
  } catch(e) {
    ActivePhoneCall = null;
Thank you,
Posted 11-Jun-12 19:10pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use traditional AJAX for ASP - XMLHttp or ServerXMLHTTP Object.
How To Submit Form Data by Using XMLHTTP or ServerXMLHTTP Object[^]
Manas Bhardwaj at 12-Jun-12 2:10am
Will Work +5!
Sandeep Mewara at 12-Jun-12 2:23am
Thanks Manas.
Soft009 at 12-Jun-12 2:47am
Thank you for the answer. Can we store data in a database using this method.
Sandeep Mewara at 12-Jun-12 3:08am
Did you go through the link? You are talking to server from this and thus will be able to save data in database.
Soft009 at 12-Jun-12 3:10am
yes, Ok i'll try it and see whether it works. Thanks a lot. +5
Espen Harlinn at 12-Jun-12 8:20am
Sandeep Mewara at 12-Jun-12 12:54pm
Thanks Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 375
1 Richard Deeming 240
2 _Amy 205
3 CHill60 195
4 Nirav Prabtani 178
0 OriginalGriff 8,104
1 Sergey Alexandrovich Kryukov 7,045
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912

Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 12 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100