Hi, In my application I am loading the image control with the image fetched from the server using the handler call in the Javascript, also using
XmlHttprequest object to prevent cancelling of the first request when the second request comes.

but the problem now is that the handler is called twice as the image url also calls the handler and the Xmlhttprequest object.send also calls it. how can I avoid this and get the image.

here with given my coding also.


function GetCameraImage(CameraName,interval)
{
var url="../UserControl/ImageHandler.ashx?Name=" + CameraName+ "&lq=" + Math.random();
if (c%5==0){
document.getElementById('CamImage').src = url ;
}
if (c%5==1){
document.getElementById('CamImage').src = url;
}
irequest.open("GET", url);
irequest.onreadystatechange =getCameraImageBack;
irequest.send(null);
c=c+1;
}

function getCameraImageBack(response)
{
if(irequest.readyState == 4 && irequest.status == 200)
{
s=setTimeout("GetCameraImage('" + CameraName + "','" + interval + "')",interval);
}
}


here irequest is the XMLhttprequest object.

the script was used in c#.net

thanks,