469,949 Members | 2,195 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

official alternative to ajax

Hi

I have asked this on the official asp.net forums but no luck so
thought I'd try here

Assume you have a page with a filter control and a grid view and many
other controls on it. When the filter changes you want the gridview to
change but nothing else. In particular all you would like to happen is
for an ajax call to occur and a new grid view to be returned.

Similarily you might have a treeview working asynchronously, you might
have an n'tiered arrangment and if the database disappears you would
want a different control on the page to indicate this, but the treeview
can't be connected to other controls in this manner (can it?)

That kind of situation is possible with Raw html and Ajax. Obviously
ajax calls are easy enough (especially using something like AjaxPro)
and to get the a table back you could just create it and return it.
Similiarly for the treeview example you could return an li/ul structure
normally plus a different control to indicate the error.

So, my question. What is the official way to do things like this. I
suspect the answer is use a postback

ta

(sig: findbyfoldface)

Oct 3 '06 #1
1 1676
I see a lot of people trying to avoid postback, as they feel painting the
page over again is somehow inferior to doing some voodoo in the back with
Ajax. And, in some cases, they are correct. In others, they are creating two
data transports that they have to maintain, simply to avoid a repaint. I do
not see this as a wise use of Ajax, but everyone has their own opinion.

You can talk to controls all day long on the client side and even wire them
to Ajax calls. If you like, you can code your own via the XMLHTTP and with
SOAP even make true web service calls from the client. As long as you emit
the client script from your code beside (behind?) page, you can get the name
of the control, no matter where it is placed, and you can then have one
control pounding on another without a complete postback.

The question is whether you want to maintain this architecture.

PROS
1. It does not completely repaint the page

CONS
1. Harder to debug a mix of client and server script
2. Less maintainable

The main benefit of Ajax (yes, I realize there are many other reasons to use
it ;->) is user accessibility. For example, the google toolbar approach
where a drop down is created on the fly or the ability to change states
based on a country, or fill in a list of cities based on a postal code.
These are very valid reasons to use an asyncrhronous transport. I do not, in
general, believe that gathering a full spreadsheet of data is the best use
for asynch (although there are certainly some specific examples when it
would be wise).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
<co**********@googlemail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Hi

I have asked this on the official asp.net forums but no luck so
thought I'd try here

Assume you have a page with a filter control and a grid view and many
other controls on it. When the filter changes you want the gridview to
change but nothing else. In particular all you would like to happen is
for an ajax call to occur and a new grid view to be returned.

Similarily you might have a treeview working asynchronously, you might
have an n'tiered arrangment and if the database disappears you would
want a different control on the page to indicate this, but the treeview
can't be connected to other controls in this manner (can it?)

That kind of situation is possible with Raw html and Ajax. Obviously
ajax calls are easy enough (especially using something like AjaxPro)
and to get the a table back you could just create it and return it.
Similiarly for the treeview example you could return an li/ul structure
normally plus a different control to indicate the error.

So, my question. What is the official way to do things like this. I
suspect the answer is use a postback

ta

(sig: findbyfoldface)

Oct 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Yarco | last post: by
4 posts views Thread by bobzimuta | last post: by
reply views Thread by melledge | last post: by
1 post views Thread by www.web20developers.com | last post: by
10 posts views Thread by =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post: by
2 posts views Thread by soni2926 | last post: by
6 posts views Thread by kj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.