AJAX - Query

K

Kuldeep

Framework: Visual Studio 2005
Technology: ASP.NET 2.0
Language: C#.NET 2.0

I have been using basic AJAX in my applications for quite some time now.
The pseudo code is a as follows:

<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest()
{
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}

function startRequest()
{
var ProvinceID=document.getElementById("DropDownList1");
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET", "?ProvinceID="+ProvinceID.value, true);
xmlHttp.send(null);
}

function handleStateChange()
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
div1.innerHTML=xmlHttp.responseText;
}
}
}
</script>

Nothing wrong with the implementations so far but I need some clarifications
on using AJAX

1. Is there any constraint on the Server or Cache while using this method
(xmlHttp = new ActiveXObject("Microsoft.XMLHTTP") or
div1.innerHTML=xmlHttp.responseText )

2. Are there any other precautions to be taken while using AJAX in our
application

3. Let us consider a scenario.

I have a requirement which has an UltraChart to be populated based on the
data fetched through a DataSet.

Now, conventionally, there would be a postback once i click the button "Plot
Graph" which populates the UltraChart and displays the Graph.

My question: How do I achieve the above mentioned result without having a
Postback using AJAX?

4. If there are any good links on AJAX with ASP.NET 2.0 please share it with
me

Thanks,
Kuldeep
 
B

bruce barker

XMLHttpRequest honors the same caching commands as the browser (as the
browser actually performs the request).

if your graph is an image, then javascript can just set the img.src to
an asp.net page that generates the image (no ajax required). if there s
too much data to pass on the image request url, use ajax to update
session, then do the image request.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top