Showing posts with label slow. Show all posts
Showing posts with label slow. Show all posts

Wednesday, March 28, 2012

Very slow and unresponsive AJAX (Calendar + Tabs)

i just installed the toolkit into Visual Studio 2005, and managed to create some sample projects

I've implemented the Tabs and Calendar onto an existing project, in the believe that Ajax would provide faster (or as fast) access then the existing solution.

in order to make the Ajax work in the project, I've copied nearly all needed elements into the web.config ( http://codebetter.com/blogs/jay.kimble/archive/2006/10/26/How-To_3A00_-Enable-Microsoft-Ajax-Beta-over-on-an-existing-site.aspx )

now - the Ajax Calendar and Tabs works, the old server side asp.net have been fitted to the new controls...

but very very slow !?!? - the calendar takes 3-4 seconds to show and a single action in it takes 1-2 seconds ?

code:

1<%@dotnet.itags.org. Control Language='vb' AutoEventWireup='false' Codebehind='ctlQuizEdit.ascx.vb'2 Inherits='SurveyFactory.ctlQuizEdit' TargetSchema='http://schemas.microsoft.com/intellisense/ie3-2nav3-0' %>3<%@dotnet.itags.org. Register TagPrefix='fcke' TagName='FckHeader' src='ctlImportDefLangHeader.ascx' %>4<%@dotnet.itags.org. Register TagPrefix='fcke' TagName='FckFooter' src='ctlImportDefLangFooter.ascx' %>5<%@dotnet.itags.org. Register TagPrefix='cc1' TagName='HeaderFooter' src='ctlHeaderFooter.ascx' %>6<%@dotnet.itags.org. Register TagPrefix="cc1" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>789<cc1:TabContainer Height="250px" Width="600px" ID="TabContainer1" runat="server">10 <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Survey">11 <ContentTemplate>12 <table id="editQuizData" runat="server" width="100%" cellspacing="1" cellpadding="2" border="0" height="10">13 <tr>14 <td align="left" colspan="2">15 <asp:Label ID="lblQuizAction" Text="Edit" Font-Bold="True" runat="server" /><br>16 <asp:Label ID="lblError" runat="server" />17 </td>18 </tr>19 <tr>20 <td align="left">Title</td>21 <td align="left"><asp:TextBox ID="txtQuizTitle" Columns="80" runat="server"></asp:TextBox></td>22 </tr>23 <tr>24 <td align="left">Description</td>25 <td align="left"><asp:TextBox ID="txtQuizDescription" Columns="80" Rows="2" TextMode="MultiLine" runat="server"></asp:TextBox>26 </td>27 </tr>28 <tr>29 <td align="left">Created by</td>30 <td align="left"><asp:Label ID="lblCreatedBy" runat="server" />31 </td>32 </tr>33 <tr>34 <td align="left" valign="top">Interval</td>35 <td align="left">36 <table id="Table1" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">37 <tr>38 <td align="left" valign="top">From</td>39 <td align="left" valign="top">To</td>40 </tr>41 <tr>42 <td align="left">43 <asp:TextBox ID="CalendarQuizFrom" runat="server"></asp:TextBox>44 <cc1:CalendarExtender ID="CalendarExtender1" runat="server"45 TargetControlID="CalendarQuizFrom" Format="dd-MM-yyyy" />46 </td>47 <td align="left">48 <asp:TextBox ID="CalendarQuizTo" runat="server"></asp:TextBox>49 <cc1:CalendarExtender ID="CalendarExtender2" runat="server"50 TargetControlID="CalendarQuizTo" Format="dd-MM-yyyy" />51 </td>52 </tr>53 </table>54 </td>55 </tr>56 </table>57 </ContentTemplate>58 </cc1:TabPanel>59 <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Header">60 <ContentTemplate>61 <fcke:FckHeader runat="server" ID="FckHeader" />62 </ContentTemplate>63 </cc1:TabPanel>64 <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Footer">65 <ContentTemplate>66 <fcke:FckFooter runat="server" ID="FckFooter" />67 </ContentTemplate>68 </cc1:TabPanel>69</cc1:TabContainer>7071<center>72 <asp:Button ID="btnSave" runat="server" Text="Save"></asp:Button> 73 <asp:Button ID="btnCancel" runat="server" Text="Cancel"></asp:Button>74</center>7576<input id="hiddenLangHeaderTxt" type="hidden" name="hiddenLangHeaderTxt">77<input id="hiddenLangFooterTxt" type="hidden" name="hiddenLangFooterTxt">78<input id="hiddenFooter" type="hidden" name="hiddenFooter" runat="server">79<input id="hiddenHeader" type="hidden" name="hiddenHeader" runat="server">80

Hi Montago,

Your program works pretty well after I removed all the UserControls. So we suggest that you should use an exclusive method that remove the controls one by one until find out the exact root cause. Also, Some helpful debugging tools will make your work easy. For example,IE WebDevelopment Helper,HttpWatch,Firebug etc.

If your problem cannot be resolved , please let me know with more information.

Best regards,

Joanthan

Very slow dragndrop in IE using DragDropManager

There are 2 realizations of DragDropManager in Ajax Controls:IEDragDropManager &GenericDragDropManager.

GenericDragDropManager works fine. But IEDragDropManager works slow, very slow. If I forcedly use the GenericDragDropManager for IE browser every works fast. It's clear that IEDragDropManager has some realization issues.

What's the problem and when it will be fixed?

Could be because you're running in debug mode... if so one of these:

1) Set<configuration><system.web><compilationdebug="false">in your web.config

2) Set theScriptMode="Release"property on the ScriptManager component

<asp:ScriptManagerID="ScriptManager1"runat="server"ScriptMode="Release"></asp:ScriptManager>

Either way, you should end up with the release version of the javascript coming down to you which is A LOT faster!!


Yeah, it's helped a little. But the draggins is still too slow and not acceptable for real world.

The problem isn't solved.

Saturday, March 24, 2012

Want to let datagrid load after page_load (AJAX)

Hello,

I have a datagrid that gets its data from a stored procedure (executed using a data adapter). It is quite slow, so I want the page to load everything first, display it to the user, and then show a 'loading' message in the div where the datagrid resides while the data for it is being fetched. How can I do this using AJAX?

Regards,

Ahmed Zainal

If you put the grid in a panel (Panel A) and have a second panel (Panel B) with a loading gif.

Put a refresh button in with the grid in Panel A. Put both panels in an update panel.

In on page load do not load anything into the grid and set Panel A visibility to false and set Panel B visibility to true.

Create a method that handles the refresh buton on click event server side and add the code to populate the grid in it.

Wire up the update panel to show the loading gif panel when it does a partial page post back and hide it again when the postback response is recieved.

In javascript fire the on click event for the refresh button in the page on load event.

Hope that makes some sense. If not I can try and put some code togethrt for you tonight after work as an example?


Richard,

Thank you for your prompt response! Just one thing. when you say:

"In javascript fire the on click event for the refresh button in the page on load event."

How do I call the refresh on click event in javascript?


For a button declared as:
<asp:ButtonID="Button_Refresh"runat="server"OnClick="Button_Refresh_OnClickEventHandler"/>
JavaScript:
window.onload = init();
function init() {
__doPostBack('<%= Button_Refresh.ClientID %>','');
}
I think that should do it.

Try this http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx

Hello

Sorry for the late reply. Internet was down on our lan since this morning!


I found a different method using an ajax timer. I set the interval to 1 millisecond and it calls the timer.tick event straight after the page loads. In the code, I set the enabled property of the timer to false so that it does not keep ticking. I also use an AJAX updateprogress control which displays the loading gif. This works great but I get another problem. I have another AJAX control that uses next and previous buttons to display news articles. If I click on one of these buttons while the datagrid is loading, the datagrid starts loading again but never binds!

Thank you and I really appreciate your help!



Hi

This could be anything, try implementing queuing. Some link below that might help:

Genral tips (Queuing half way down):http://www.codeproject.com/Ajax/aspnetajaxtips.asp

Async calling:http://forums.asp.net/p/1068907/1553801.aspx#1553801

Queuing class:http://www.cmarshall.net/MySoftware/ajax/index.html

Hope one of these helps.