Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

AJAX, ASHX, IMAGE

$
0
0
Hello,
I create dynamic image (.png). 
It takes  10-15 sec. 
I would like to add busy indicator, but I could not make second part work.
Server side is the same, or I have to change it?
I could not find right example.
//first - works
    function Refresh() 
    {
        document.getElementById("Image").src = "ViewHandler.ashx";
        document.getElementById("Image").style.visibility = 'visible';
    }
-----------------------------------------------------
//second - doesn't work
    function Refresh() 
    {
        spinner.style.display = 'inline';

        var url = "ViewHandler.ashx";
        xmlHttp = GetXmlHttpObject(OnComplete);
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }

    function OnComplete() 
    {
        if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") 
        {
            document.getElementById("Image").src = xmlHttp.responseText;
            document.getElementById("Image").style.visibility = 'visible';

            spinner.style.display = 'none';
        }
    }


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>