![]() |
Web Development »
Applications & Tools »
Applications
Intermediate
License: The Code Project Open License (CPOL)
A. R. Live Support: XML Based Customer Support Chat SolutionBy Aman BhullarCustomer Support chat solution build using ASP.NET(2.0) with C# and XML as a database. |
C# 2.0, ASP.NET, Ajax
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

I have checked out a lot of chat solutions and all of then were database driven. These applications fail as soon as the database is down and in live systems, this scenario is not unknown. So, I decided to build a Chat Solution that should be database independent. So, XML is the best replacement.
This is my first article and A. R. Live Support is the first solution I have developed using XML.
A. R. Live Support is an online chat software, developed in ASP.NET(2.0) and XML. It is easy to use and facilitates 1-o-1 live communication between customers and executives. It is a flexible live chat software that provides the customer support with a click.
The main features are:
I will start from a code that will be used to call the Server repeatedly for fetching the most recent information:
function InitializeTimer()
{
// Set the length of the timer,
// in seconds. Your choice
secs = 2;
StopTheClock();
StartTheTimer();
}
function StopTheClock()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function StartTheTimer()
{
if (secs==0)
{
StopTheClock();
ajax_MakeAnAJAXGetCall();
//Generate a Postback to the server
InitializeTimer();
// Start the timer again
}
else
{
secs = secs - 1;
timerRunning = true;
timerID = self.setTimeout("StartTheTimer()", delay);
}
}
//AJAX Function
function makeRequest()
{
var xmlHttpRequest = null;
/*
* For Firefox, Mozilla, Safari
*/
if (window.XMLHttpRequest)
{
xmlHttpRequest = new XMLHttpRequest();
}
/*
* For Microsoft Internet Explorer
*/
else if (typeof ActiveXObject != "undefined")
{
xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlHttpRequest;
}//END of Function makeRequest
function ajax_MakeAnAJAXGetCall()
{
ajaxObj = makeRequest();
//alert('HELLO');
if (ajaxObj != null)
{
var dt = new Date();
var URL = serverURL;
URL += '?id=' + document.getElementById('lblID').innerHTML +
'&dt1=' + dt.getHours()+ '&dt2=' + dt.getMinutes();
//alert(URL);
StopTheClock();
ajaxObj.open("GET", URL, true);
ajaxObj.onreadystatechange = ajax_CallBack;
ajaxObj.send(null);
}
else
{
}
return false;
}
function OpenPop(strId)
{
window.open('execChatWindow.aspx?id=' + strId,'','width=520,height=490');
}
function ContactServer()
{
ajax_MakeAnAJAXGetCall(); //THis makes Ajax call to run
}
Server side code to fetch the messages for User/Executive:
string strResult = string.Empty;
try
{
string chatId = Request.QueryString["cid"].ToString();
string strXML = chatId + ".XML";
strResult = clsChatMessages.getUnReadMessages(Request.PhysicalApplicationPath,
strXML,Request.QueryString["id"].ToString(), true);
}
finally
{
}
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 16 Dec 2008 Editor: Deeksha Shenoy |
Copyright 2008 by Aman Bhullar Everything else Copyright © CodeProject, 1999-2009 Web19 | Advertise on the Code Project |