473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Slower with AJAX?

I am new to AJAX.
I am applying AJAX to a current web solution to get the "instant behaviour".
On my main page I have two sets of criteria: Specific and Wide.
Each set is placed in a View container.
I am not sure that I configured the Triggers correct, but the behaviour is OK.
When I click the linkbuttons they switch between two sets of search controls.
When I click the search buttons they reload the display panel.

BUT .... if the display panel is loaded with lots of data it takes an awful
lot of time to switch search panel! It also takes far too long time to
perform the next search. How can the current page data load affect the next
execution time?

Before I applied AJAX I was quite satisfied with the page. It gave a pretty
fast response to all actions. The only adjustment I needed was to avoid full
page rewrite when not needed. When I did, I also increased response times
enormously!

I appreciate all kinds of suggestions.

<asp:UpdatePanel ID="pnlSearch" runat="server">
<ContentTemplate>
<asp:MultiView ID="SearchMode" runat="server">

<asp:View ID="Specific" runat="server">
(Several criteria controls goes here ....)
<asp:LinkButton ID="lnkShowWide" runat="server">
<asp:Button ID="btnSearchSpecific" runat="server"
CssClass="inputbox" Text=" View " />
<asp:UpdateProgress ID="myUpdateProgress" runat="server">
<ProgressTemplate>
<img src="./CommonUI/Web/images/indicator.gif" title="Updating
page content" alt="" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:View>

<asp:View ID="Wide" runat="server">
(Several criteria controls goes here ....)
<asp:LinkButton ID="lnkShowSpecific" runat="server">
<asp:Button ID="btnSearchWide" runat="server" CssClass="inputbox"
Text=" View " />
<asp:UpdateProgress ID="myUpdateProgress" runat="server">
<ProgressTemplate>
<img src="./CommonUI/Web/images/indicator.gif" title="Updating
page content" alt="" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:View>
</asp:MultiView>

</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="lnkShowSpecific" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lnkShowWide" EventName="Click" />
</Triggers>
</asp:UpdatePanel>

<asp:UpdatePanel ID="pnlDisplay" runat="server">
<ContentTemplate>
(Nested repeater control with long result list ...)
</ContentTemplate>

<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSearchSpecific"
EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnSearchWide" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
Apr 19 '07 #1
8 2558
Hi,

Based on my understanding, your question is:

1) You previously have a MultiView with two View to switch between two
parts of your user interface.
2) You now put the MultiView in UpdatePanel to switch using AJAX, and you
found the switching time is much longer than in normal postback mode.

Please feel free to let me know if I've misunderstood anything.

Well, I must say this issue also looks strange to me. After all, there's
still a normal postback on the server-side; this should not make the
rendering slower.

I'm wondering if you could create a smaller but complete and reproducible
web project for further insepection? Thanks for your effort.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 20 '07 #2
No, the MultiView is not really the problem. Actually it is very easy to
exchange it with a simple clientscript to toggle between different criteria
views.

The confusion is the interaction between the two UpdatePanels.
In the first UpdatePanel is the Search button that triggers result to the
second UpdatePanel. The problem is that the Search result is extremely slow
when the current content of the second UpdatePanel is long! I can not
understand why the current page content should affect the response time at
all.
As I mentioned I got the same effect when switching between two Views in
first UpdatePanel if the content of the second UpdatePanel was heavy. It
should be instantaneous and not care about the other UpdatePanel.

Is there a tutorial somewhere as to how the MS AJAX controls should be used?
Many UpdatePanels, Triggers between UpdatePanels, Many Triggers in same
UpdatePanel, One or Many UpdateProgress, etc.

Apr 20 '07 #3
Hi,

Thanks for the update and sorry for the delay.

Please use Web Development Helper
(http://projects.nikhilk.net/Projects/WebDevHelper.aspx) to monitor the
http traffic. Will you see large data get sent to server when switchting
the search view when there's a large result in the search result?

For AJAX documentation on multiple UpdatePanel, please refer to following
URLs:
#ASP.NET AJAX Overview The UpdatePanel and UpdateProgress Controls >
UpdatePanel Control Overview
http://ajax.asp.net/docs/overview/Up...lOverview.aspx

#ASP.NET AJAX The UpdatePanel Control Creating a Simple ASP.NET Page
with Multiple UpdatePanel Controls
http://ajax.asp.net/docs/tutorials/C...datePanel.aspx
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 23 '07 #4
I am not familiar with WebDevHelper but downloaded it.
It looks quite similar to Firebug that I downloaded last week.

The links you provided were good and gave a better understanding, but I did
not find the answer to my specific question.

I am not sure I interpret all the results of WebDevHelper correct but I
notice a substantial difference in request size when clicking the link in
both scenarios: 12000 to 330000. The only difference I can find on the page
is that the content in UpdatePanel pnlDisplay is much bigger in the second
case.

But the LinkButton is inside UpdatePanel pnlSearch and is triggered only to
this UpdatePanel. Why does the size of the other UpdatePanel affect the
response time? Both panels are set to UpdateMode=Conditional. Does a
PostBackAsyncControl still submit the whole page?

I have now designed another version of the same page where I use a client
side script to switch between different criteria views. It is of course much
more effective in all ways and avoids the above problem. But I am still
curious as to why I got the delay in the first scenario.

I feel a bit hesitant to use a technique when I don't understand the
behaviour.

Apr 23 '07 #5
Hi Jikob,

Thanks for the updated information and I can understand the issue more
clearly now.

The key point here is that with UpdatePanel, only the response from the
server will be "partial"; not the request. The request is controlled by
HTML form submitting: every input fields on the HTML form will be sent to
the server when the form is submitted. Although UpdatePanel will intercept
the form submitting, it only adds some extra information to help the
server-side code to filter out unneeded information from the response.

You can test this by using following test page:

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Button2_Click(object sender, EventArgs e)
{
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.Add("Name");
for (int i = 0; i < 1000; i++)
{
dt.Rows.Add("Row " + i.ToString());
}
Repeater1.DataSource = dt;
Repeater1.DataBind();
}

protected void Button1_Click(object sender, EventArgs e)
{
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Partial
Rendering" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click"
Text="Load Bound Data" />
<asp:Button ID="Button3" runat="server" Text="Normal Postback" />
<asp:Repeater EnableViewState="false" ID="Repeater1" runat="server">
<ItemTemplate>
<asp:TextBox ID="txt1" runat="server" Text=<%# Eval("Name")
%>></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
Using above test, you can see both in the partial rendering mode and full
page postback mode, the request will always include those TextBox generated
by the repeater control. After all, for a partial page rendering, it's
still a normal postback for the server-side code and you can access all the
control's state there; it's only the returned data will be filter according
to which UpdatePanel(s) are needed to be updated.

Hope this could help you better understand how the ASP.NET AJAX UpdatePanel
works. Please feel free to let me know if there's anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 24 '07 #6
Thanks for your explanation, I get the idea.

Is it possible to overcome this in some other way, not submitting the whole
page?
I tried double forms but that is obviously not allowed .....

Apr 24 '07 #7
Hi,

I'm still researching on your question and will get back to you as soon as
I got further information. Thank you for your patience and understanding.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 25 '07 #8
Hi,

I've done some research, unfortunately I didn't see any approach to control
which fields get submitted to server.

In summary, this question is actually not related to AJAX, this is the
intrinsic behavior of html form.

Please feel free to let me know if there's anything unclear. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 30 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
0
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
0
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
6
by: mtl | last post by:
I have high speed internet on a fairly fast machine, but the time to load messages seems much longer with latest changes on google groups. Also increased ads on the right make the messages much...
10
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
controlsPlease could some of you here post some of your live examples of AJAX (esp drag panels, collapsable panels, and popup menu.) (It's one thing to talk about how great something is, but it's...
2
by: soni2926 | last post by:
hi, does anyone know of any good books on ajax and asp.net, one that teaches ajax itself before jumping in atlas? I wanted to get an understanding of ajax and how to use it, most books i've seen...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.