ajax or not to ajax.

Heres a strange one for you. I have a textbox, a button and a gridview on a page. I enter some search text which returns 500 odd records in under a second. When i wrap the gridview in an updatepanel, set its update mode to "conditional" and the trigger to the button the page can take 2-4 seconds to render.

I think the problem is down to page redering some how as my progress indicator stops at around the same time as the normal postback would appear.

0
Lee
8/10/2007 1:48:55 PM
asp.net.ajax-ui 9760 articles. 0 followers. Follow

7 Replies
3339 Views

Similar Articles

[PageSpeed] 31
Get it on Google Play
Get it on Apple App Store

I have also noticed this very behaviour and have come to the conclusion that in cases like this it is better to hand code a XMLHttp call to a webservice. The updatepanel and gridview combination is not very efficient if you have a large number of records.


Regards,
Prashant


Dont forget to click "Mark as Answer" on the post that helped you.
0
Prashant
8/10/2007 2:23:04 PM

Tables aren't known for their lightning fast rendering speeds, in general.  It likely takes just as long to render in a full postback, but you wouldn't notice as much due to the full page refresh.

The UpdatePanel mechanism itself isn't going to affect the speed of that.  All it does is retrieve newly rendered HTML and replace the UpdatePanel's div's content with that.  There is no actual post-response rendering overhead caused by an UpdatePanel. 


Encosia - ASP.NET, AJAX, and more.

Latest article: Using complex types to make calling services less… complex
0
gt1329a
8/10/2007 5:19:54 PM

Hi, and thanks for the replys. I agree with what your saying but there really is quite a performance impact and in fact so much that i have gone back to using postbacks rather than an update panel. The lag seems to be with rendering to the fresh content.

0
Lee
8/13/2007 7:25:04 AM
The problem is that browsers render large tables slowly, regardless of the UpdatePanel.  If you dynamically generated a large table using JavaScript on the client side, with no AJAX, and added that to the DOM, you would see the same slow rendering.

Encosia - ASP.NET, AJAX, and more.

Latest article: Using complex types to make calling services less… complex
0
gt1329a
8/13/2007 2:02:25 PM

ok, thats crystal clear now thanks. So in essence this is a big problem if your using a gridview. Would customising the output from tables to divs improve the situation.

0
Lee
8/13/2007 3:27:02 PM

Divs usually render faster, yes.


Encosia - ASP.NET, AJAX, and more.

Latest article: Using complex types to make calling services less… complex
0
gt1329a
8/13/2007 4:00:54 PM

The original posted problem is an interesting one.  The issue at hand is not really slow rending of the table.

 Example:

1. Create 2 tables on a page.  On page load, put a table with 5000 rows in the first table.  Create a button that will trigger a postback.  In the event, clear out the original table and add the same data into the second table.  The action here is to move data from one table to the other.  Now run the page.  You will notice that there is a slight load time for the table, but it is less than a second.  The tables render very quickly.

2. Now, add update panels around both tables.  Have the button trigger a partial page load that will move the data from the first table to the second table.  Include an update progress bar with an animated gif in it.  Now click the button to do the transfer and you will see the update gif go for about a second then stop.  This signifies that the server code is done running and now the client side code is doing rendering (or something, I have no idea).  Everything in the page will seem to freeze for a long time, at least 10 seconds.  This is unreasonable.

3. There is a work around for this.  When you click the button, you will want to run some javascript before the async postback.  This javascript should clear out the contents of the first table.  Now deleting rows in a table that big is not quick, so the best solution is to put a div around the table and set the innerHTML of the div to "".  This clears out the html of the large table and somehow makes the partial postback happen as quickly as a regular postback with no delays.

This is very odd behavior and I believe it is an issue with internet explorer rendering code.  I tried the above example in step 2 with firefox.  I experienced no delays.  As for IE, the workaround in step 3 works, but I don't know why.  If anyone has any extra light to shed on this subject, I would love to know.

0
bunkscene
11/8/2007 2:44:20 PM
Reply:

Similar Artilces:

To AJAX, or not to AJAX?
Some body suggested to me to use AJAX. I figured it's not the brand name detergent nor the Dutch city. So here is what I have and please tell me if it ca be done with ajax, and perhaps point me to some examples, etc. The page contains several GridViews and FormViews that display data using several data calls. (Yeah, there is my first issue. Need to figure out how to cash all that.) This is an application that track work orders, so the top most FV has the user info and summary information of the work order. It is editable and so far it works well. There is also another set of infroamt...

My AJAX is not AJAXing!
Hi, I was having trouble with a new AJAX enabled code so I tried to just to do a simple test page. I did the simple Label control with button example covered in this tutorial http://www.asp.net/learn/ajax/tutorial-01-cs.aspx I'm having the same problem. Functionalitw-wise it works but the page is refreshing and flickering. That means it's not the code but maybe my set up. I'm using VisualStudio 2005 and the application is currenty .NET 2.0. In VS.NET, I do see the AJAX controls though. What could this be?Thanks,Sam did you install the Ajax extensions? Now, it's AJAXing!...

Like AJAX, but not AJAX
When a user submits a page, i want the submit button to be disabled the text be something else like [ Loading.... ] and when the page loads after post back , the button should be enabled and the text  be [ Submit ]. Is it possible to do this without AJAX in asp.netNoob Rocks You will need to use javascript. One way you can do it, add this attribute in the page_load event:Button1.Attributes.Add("onclick", GetPostBackEventReference(Button1) + ";this.value='Please wait...';this.disabled = true;");This does have its limitations, but it should work. www.hopeasp.net Are you...

The Ajax Tabcontrol
Hi! Neat control that tabcontrol but for some reason it doesn't compleatly flies on the wings of ajax. This is what I have and what I want:  I have four tabpanels nested into the parent Tabcontrol container. In these tabpanels I have a Updatepanel each. What I want is that when I change tabs for example from tab 1 to tab 2 the content in the Updatepanel in tab 2 should be updated. I have on each page a refesh button that can refresh it with out a full postback, but for somereason no matter how I do it I can seem to get the updatepanel to refresh without a full postback wheb sw...

Converting Non Ajax enabled project - to an Ajax enabled
I have a new requirement which needs a calendar control as in the ajax toolkit.But my application is in VS 2005 and is not an ajax enabled project. How difficult is it to convert the project to an ajax enabled one?If it is relatively easy to do it, will the conversion affect the behavior of the other pages within the projectwhich essentially dont use ajax functionality? Can someone please advise ? Hi,Converting your web application to Ajax enabled is very simple. It won't affect the other pages in you application.You can read about it in the following links:How Do I:Add ASP.NET AJAX ...

adding Ajax to my non-Ajax .NET web site
Hi all I've a site that i developed by .NET (visual studio.net 2005 - VB.net) and want to add Ajax into the pages now. I've downloaded required AJAX tools and be able to develop AJAX enabled pages but want to integrate ajax features to existing pages. Could you please help me how i can do this? Thanksmcb Look at the videos here: http://www.asp.net/learn/ajax-videos/  (number 7 in particular)Steve Wellens My blog if a web site is a normal asp web site then u have to add these lines in web.config under the system.web tag         <httpHand...

Does anyone know of either an ajax.net blog available or an 'inline editor' for ajax.net?
Hey all:  I'm desperately trying to find an AJAX control (I don't care if it's currently for ASP.NET AJAX.NET, since if not, I'll do the conversion and make it available to others) for creating blogs and another inline editor control, so that if there is text on the page, I can click on the text and it will automatically display an editor and allow me to edit the text/html.  Does anyone know of a control like this that's AJAX enabled?  Especially AJAX.NET.  I'm only interested in open-source, since any improvements I make I will make available on codeplex.com Thanks in...

Old AJAX in .NET 1.1 compatibility with .NET framework 2.0. Ajax does not work always ....................
Hello,I have converted the web site from .NET 1.1 to .NET 2.0. Some of the pages in the web site use AJAX which was developed in .NET 1.1Ajax does not work smoothly in .NET 2.0. Do I have to use ATLAS or is there any fix I can use to make the AJAX work ?Please let me know. Many thanks in advance. Nick..........

AJAX Master Page, AJAX Web Form and AJAX Client Control Question?
I gues to get the ball rolling I have VS 2008 and I am creating ASP.NET websites. I have programmed with VS 2005 and always had to add AJAX features by hand. Now in VS 2008 you have new templates AJAX Master Page, AJAX Web Form, AJAX Client Behavior, AJAX Client Control, AJAX Client Library, AJAX-embeded WCF Service On these three templates AJAX Master Page, AJAX Web Form and AJAX Client Control. What makes them different from normal templates? Is it just a matter of adding the script manager to the page or is using a AJAX Master Page have a huge benefit over doing individual pages? I have...

old ajax-new Ajax
hi i am using atlas in some asp.net pages and january ctp in some pages. now that i want to reuse those pages in my new ctp enabled site i am getting atlas errors. is the january ajax not supporting atlas toolkit. Hi, If I'm not mistaking it uses the ASP.NET Extensions 1.0 version instead of Atlas. It's probably best that you upgrade your atlas site to use ASP.NET AJAX 1.0 unless you have a specific reason not to. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. What error exact u are getting.??? Post the error here...

AJAX : Session Lost in Ajax
  Session Variable's Value  Lost  When Use  Update Panel In Page .  Rajeev Kumar TiwariMicrosoft Professional ...

Is AJAX really AJAX anymore?
Was just curious as to what others think of the term AJAX, and it's relevence. I mean yes we can still return XML, but I think most people return JSON now so does the term AJAX really apply anymore or should it be AJAXOJSON (Asyncronous Javascript And XML Or Javascript Object Notation) Thoughts?Evan's BlogCodeundrum: Code that puzzles. Evan Freeman: but I think most people return JSON now I think you may over estimate JSON.... I would say the opposite. Nearly all the "Ajax" work I see is actually Ajax..... I was drawing an architecture diagram on my whitebo...

What are Ajax and Aspnet Ajax ,both work the same?
Hi, Hope some1 can help to explain. I am a bit of confused. For what I know, ajax, it is a native Javascript inside the javascript Library. and it is supported by most browser. To use ajax , I have to create it like this for Ms IE: var xmlHttp xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      or  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  I believe I can use this script in Aspx page in Html section.     To use Aspnet Ajax:  How do I create the Ajax Object? And How do I use the ajax Properties and Methods? ...

ajax gallery or ajax slideshow
where can i get codes for ajax gallery or ajax slideshow for asp.net 2.0(vb)??? Hi melvinc, "Silverlight powered Slide Show"gallery can be a option.Try using: http://nikhilk.net/Silverlight-Slideshow.aspx    PeeyushDo mark the most helpful reply/replies as "Answer". how can i link ms access to my slideshow using webservices ans asp.net(VB)??? Hi melvinc, The above control does not use any database. It uses an xml file to maintain albums and their associated photos.PeeyushDo mark the most helpful reply/replies as "Answer". Hi, Did you...

Web resources about - ajax or not to ajax. - asp.net.ajax-ui

Ajax - Wikipedia
Ajax may refer to: Mythology Ajax (mythology), son of Telamon, ruler of Salamis and a hero in the Trojan War, also known as "Ajax the Great" ...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

CIA : Operation Ajax the Interactive Graphic Novel for iPad for iPad on the iTunes App Store
Get CIA : Operation Ajax the Interactive Graphic Novel for iPad on the App Store. See screenshots and ratings, and read customer reviews.

Windows Live Hotmail - Non AJAX Screenshot - Flickr - Photo Sharing!
Windows Live Hotmail Integrates both mail and web search functionality.

U.S. and Them: Operation Ajax - Iran and the CIA coup (1/2) - YouTube
Part 2: As nationalism begins to spread through the region the Iranian call to nationalize its oil resources threatens Britains oil interests ...

UCL round-up: Celtic claim narrow win, Ajax held, Monaco put one foot in playoffs
Dedryck Boyata's late goal gave Celtic a 1-0 home win over Azerbaijani side Qarabag in their third qualifying round first leg clash on Wednesday. ...

Aussie DJ Ajax killed after being hit by a truck in Melbourne
UPDATE: AUSTRALIAN DJ Ajax, who died suddenly on his birthday yesterday, has been remembered as a pioneer who changed the nation's dance music ...

On-loan keeper's mistake helps Ajax to win at Eagles
Ajax Amsterdam had their own on-loan goalkeeper Mickey van der Hart to thank for a late 2-1 win at Go Ahead Eagles in the Dutch championship ...

Manchester United dominate Ajax in Europa League debut
Manchester United dominate Ajax in Europa League debut

Adelaide United's Awer Mabil inching closer to Ajax move
Adelaide United youngster Awer Mabil looks likely to move to Amsterdam club Ajax.

Resources last updated: 1/23/2016 6:53:13 AM