Why use Ajax -- All comments welcome

  • Thread starter Thread starter Wannabe
  • Start date Start date
W

Wannabe

We are looking at Ajaxing our existing web application. Question is...Should
we Ajax any and everything we can, or not? One example...if a page posts back
to itself, is that a good candidate for Ajax?
 
We are looking at Ajaxing our existing web application. Question is...Should
we Ajax any and everything we can, or not? One example...if a page posts back
to itself, is that a good candidate for Ajax?

If it's posted back just to execute some server code and to update a
part of the page (for example just to show a message "record saved")
then it could be done using Ajax. The advantage of Ajax here would be
an update of piece of web page without reloading the entire page.

To be or not be is the question :-)
 
Maybe. I started playing around with it a while ago to see if it would be
useful or not and so far, I found it quite interesting. Not useful yet but
getting there. I haven't had the chance to look at all of the controls or
extenders yet but making my way there. I have found 1 control that could
prove extremely useful in saving postbacks when changing content on a
website. Its the accordion control. It can change the content of parts of
the site without postbacks. The update pannel is the same way. I have been
tempted to ajax up every possible place possible on my website, but hold
off. Guess I'm sort of conservative on that point (don't do it unless its
required). Part of this is company saying it has to be that way but....if it
were my choice?...

Either way, it looks like a good choice. If you use the accordion control,
watch out because it has a few bugs in it. The problems with it are:

1. In design mode, when adding accordion panes, the designer doesn't put the
<Panes> tag around the pane controls.
2. You have to remove the accordion_extender control from the accordion
control since it appears that a "accordion_extender" never has existed.
3. It appears that you have to manually insert the SelectedIndex="..."
property since the designer fails to include it in the code.

They are all not that hard to work around though (after trying to figure it
out for a while). So, at this point, not for sure what to think. HTH...
 
Anything and everything?

Probably not.

The great programmers answer is...
"It depends."

Postbacks that are only going to cause a small update to the page are a
great place to start.

I certainly wouldn't make the entire website one great big
postback/updatepanel. While it would be an interesting concept, it would
probably be more work to maintain then it is worth. It would also give
you a one page web site from a search engine perspective.

-----Original Message-----
From: Wannabe [mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 4:52 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Why use Ajax -- All comments welcome
Subject: Why use Ajax -- All comments welcome

We are looking at Ajaxing our existing web application. Question
is...Should
we Ajax any and everything we can, or not? One example...if a page posts
back
to itself, is that a good candidate for Ajax?
 
As the others have said, when you need partial page updating, Ajax is a good
candidate. But, I have seen sites that use it excessively. I saw one site
that used it to implement tabbing behavior on their home page to simulate
that one page being 5 pages. Each time you simply hovered, not even
clicked, a tab the first tabs contents would go away and the next tab's
contents would appear. Since, really, the whole displayed content was being
replaced the only benefit of Ajax was that the screen didn't flicker, as it
would with a normal page.
 
Depends on TimeFrame, Budget and needs of your users.

I would start by adding some easy partial rendering (not abusing, e.g. just
add a nice updatepanel for a heavy grid...), find bottlenecks and apply
scriptservices where users are complaining.

But if you have the money and the time to invest... do it all scriptservices
based :-).

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 
Scott M. said:
As the others have said, when you need partial page updating, Ajax is a
good candidate. But, I have seen sites that use it excessively. I saw
one site that used it to implement tabbing behavior on their home page to
simulate that one page being 5 pages. Each time you simply hovered, not
even clicked, a tab the first tabs contents would go away and the next
tab's contents would appear. Since, really, the whole displayed content
was being replaced the only benefit of Ajax was that the screen didn't
flicker, as it would with a normal page.

I have a good reason. I have a site I use to play my mp3 collection. I use
the WMP control and allow myself to browse the contents of my collection
while playing. If there was a full page refresh I would interupt the
playing. All this to say that if you are trying to emulate the look and
feel of a windows app AJAX is the way to do it.

LS
 
Maybe. I started playing around with it a while ago to see if it would be
useful or not and so far, I found it quite interesting. Not useful yet but
getting there. I haven't had the chance to look at all of the controls or
extenders yet but making my way there. I have found 1 control that could
prove extremely useful in saving postbacks when changing content on a
website. Its the accordion control. It can change the content of parts of
the site without postbacks.

Keep in mind that with some (usually smaller) sites you can stuff everything
into one file and just position it/expose it on the client side with trivial
Javascript code and CSS ... one trip to the server, no postbacks, no Ajax

if there's 6 dozen pancakes on the breakfast table, and they taste really
good, should I eat all of them? probably not

use Ajax, like any other tool, where it makes sense to use it
 
Back
Top