Ajax makes a round trip doesn't it?

N

needin4mation

I understand this is a asp.net group, but thought I would post this
here for comments. I admit I have used this post in another group, but
it has less traffic. Here's to hoping I'm just blind to the obvious:

I have been reading a lot about AJAX. I want to use it and will. But
I keep reading about how it doesn't make a roundtrip to the server, no
postback, etc. But isn't the truth that *something* makes a trip to
the server? It may be int the background, but there still is a trip to
the server to retrieve data, so I'm not real sure of the benefit.
Again, I think I see the light (and I realize ajax isn't correct for
every problems), but I'm not quite sure.

For example, say I have a zip code and when I choose that zip code the
proper city comes up. I could do that with a roundtrip/postback to the
server - the whole page and get the correct cities, or I can keep the
current page and in the background have the correct city come up.

But what is the benefit here? It still takes the same amount of time
to gather the data, maybe? It's just chunked up so that it doesn't
feel as long? Believe me. I'm no knocking Ajax, just trying to
understand and justify it. Hey, it's neat.
 
S

Shawn Wildermuth

Hello (e-mail address removed),

The benefit in Ajax (and where Ajax makes sense...it isn't everywhere) is
the ability to improve the user experience. Now, when a postback happens,
the entire page is reprocessed and the html is re-delivered to the client
(with any changes). Ajax allows you to do the round-trips to the server
with only the data that you really need. For example, with maps.google.com.
It asks for new images for parts of maps you are looking at behind the scene.
In the old days, you would repost the whole page and the experience for
the user was more more jumbled. I think Ajax has a future, but in truth...we've
done Ajax for years...we are now finally getting a framework (Atlas I think?)
to do some of the heavy lifting.

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
 
L

Lau Lei Cheong

I'm new to the idea of Ajax (I know it's a hot topic sometime before, but
somehow I just ignored the topics.). But it just sounds like having a
<iframe> for updating data will do the similar thing, won't it?
 
S

Scott Mitchell [MVP]

A good summary on AJAX can be found at:
http://en.wikipedia.org/wiki/AJAX

Personally, I like a lot of things about AJAX (the improved response,
the seamless user experience, etc.), but if it's not done right there
can be some big pains, like lack of bookmarkability, back button not
working as expected, and so on.
 
S

Shawn Wildermuth

Sure, if you want a whole section to work in an IFrame. It's simply using
JScript to load data from teh server. NOt rocket science.

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
 
M

Mr Newbie

I used to use Ajax to clean my toilet. Sounds like nothing much has changed
!

;o)
 
N

needin4mation

Isn't it less secure since they can see what page you are calling in
the background and your querystring?
 
L

Lau Lei Cheong

I'm talking about using javascript to control it, of course.

and the page returned doesn't necessary contain visualable elements. A page
full of hidden box, or just 1 hidden box with hex-encoded content will do
the job for most case.

I haven't tried the crazy idea to change to handler of .js to
aspnet_isapi.dll in order to have some dynamically generated .js files for
<script> tag, but I believe that there are some chance of success (although
the browser may just ignore the javascript file change once the script is
loaded)

Seems there's all sorts of crazy implementation to do the task before Ajax.
 
G

Guest

Yes there is a roundtrip for every AJAX action and there tend to be many of
them.

The benefit is that there is no HTML, GIF, CSS, JavaScript-Includes...
loading when using theses roundtrips so they are small, fast and asynchronous
(not blocking).
Calling a server using AJAX is like requesting a very specific question
(like : give me the newest information).
Using classic web applications with standard ASP.NET, JSP and Struts, PHP,
.... you always ask for "everything" (like: give me the web form for the
ticket system, including the newest information).

From an academic perspective: It's a better separation of model view and
controller.

Have a look at http://mathertel.devhost1.centron.net/AjaxEngine/Default.aspx
 

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

Similar Threads

AJAX v. Postback 4
Ajax or just javascript 2
AJAX 10
Ajax DropDownList 2
slimmed .NET AJAX controls? 1
simple ajax drop down list 1
AJAX and IsPostBack 5
Session Time out with Ajax 1

Top