Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

AJAX - Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kuldeep - 18 Sep 2007 07:53 GMT
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
bruce barker - 18 Sep 2007 16:26 GMT
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)

> Framework: Visual Studio 2005
> Technology: ASP.NET 2.0
[quoted text clipped - 64 lines]
> Thanks,
> Kuldeep

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.