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

Saturday, March 24, 2012

ListView rendering problem(Bug?)

Hi forum,

i got a problem when binding a listview against the Nortwind customers table (any table with 10 + cols). The rendering is very slow, slower than using an update panel to refresh the whole gridview.

So, i post my code and hope there is something wrong on it. Sorry for the long post, but put the initial data there was the olny way to make sure any one can just download it to a Atlas App folder and run it.

I tried to follow the examples provided, so i think the code is good, just with more cols because all the databind samples are with just a few cols. I'd like to know the opinion of the Atlas team about binding to tabular data.

<%

@dotnet.itags.org.PageLanguage="C#" %>

<!

DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

scriptrunat="server">

</

script>

<

htmlxmlns="http://www.w3.org/1999/xhtml">

<

headrunat="server"><title>AtlasListView</title><styletype="text/css">div.listViewTable {font-family:Verdana,sans-serif;font-size:.9em;position:relative;}div.tableHead,div.tableBody {white-space:nowrap;overflow:visible;width:100%;}div.tableHeadspan,div.tableBodyspan {width:80px;padding:.2em;display:inline-block;border:1pxsolid#6495ED;border-top-width:0;border-bottom-width:0;}div.tableHead {background-color:#87CEFA;font-weight:bold;}div.listItemCssClass {background-color:#FFFACD;white-space:nowrap;overflow:visible;width:100%;}div.alternatingListItemCssClass {background-color:#FFFFF0;white-space:nowrap;overflow:visible;width:100%;}div.listItemCssClassspan,div.alternatingListItemCssClassspan {white-space:normal;}</style>

</

head>

<

body><formid="form1"runat="server"><atlas:ScriptManagerID="scriptManager"runat="server"></atlas:ScriptManager><h2>Customers list</h2><divid="listViewDiv"class="listViewTable"><divid="tableHeadDiv"class="tableHead"><span><aid="CustomerIDLk"href="javascript:;">CustomerID</a></span><span><aid="CompanyNameLk"href="javascript:;">CompanyName</a></span><span><aid="ContactNameLk"href="javascript:;">ContactName</a></span><span><aid="ContactTitleLk"href="javascript:;">ContactTitle</a></span><span><aid="AddressLk"href="javascript:;">Address</a></span><span><aid="CityLk"href="javascript:;">City</a></span><span><aid="RegionLk"href="javascript:;">Region</a></span><span><aid="PostalCodeLk"href="javascript:;">PostalCode</a></span><span><aid="CountryLk"href="javascript:;">Country</a></span><span><aid="PhoneLk"href="javascript:;">Phone</a></span><span><aid="FaxLk"href="javascript:;">Fax</a></span></div><divid="ListView1"class="tableBody"></div><divstyle="display: none;"><divid="ListView1_layoutTemplate"class="tableBody"><divid="ListView1_itemTemplate"><spanid="CustomerID"></span><spanid="CompanyName"></span><spanid="ContactName"></span><spanid="ContactTitle"></span><spanid="Address"></span><spanid="City"></span><spanid="Region"></span><spanid="PostalCode"></span><spanid="Country"></span><spanid="Phone"></span><spanid="Fax"></span></div></div><divid="ListView1_emptyTemplate">

No Customers records found.

</div></div></div><divid="pageNavigator"><inputtype="button"id="firstPageButton"value="<<"/><inputtype="button"id="previousPageButton"value="<"/><spanid="pageIndexLabel"></span>

/

<spanid="pageCountLabel"></span><inputtype="button"id="nextPageButton"value=">"/><inputtype="button"id="lastPageButton"value=">>"/></div></form><scripttype="text/xml-script">

<page xmlns:script=

"http://schemas.microsoft.com/xml-script/2005">

<components>

<dataSource id=

"customersDataSource" autoLoad="true">

<initialData>

<![CDATA[

new Sys.Data.DataTable(

[

new Sys.Data.DataColumn("CustomerID",String,null,false,true),new Sys.Data.DataColumn("OriginalCustomerID",String,null,false,false),new Sys.Data.DataColumn("CompanyName",String,null,false,false),new Sys.Data.DataColumn("ContactName",String,null,false,false),new Sys.Data.DataColumn("ContactTitle",String,null,false,false),new Sys.Data.DataColumn("Address",String,null,false,false),new Sys.Data.DataColumn("City",String,null,false,false),new Sys.Data.DataColumn("Region",String,null,false,false),new Sys.Data.DataColumn("PostalCode",String,null,false,false),new Sys.Data.DataColumn("Country",String,null,false,false),new Sys.Data.DataColumn("Phone",String,null,false,false),new Sys.Data.DataColumn("Fax",String,null,false,false)

],

[

{

"CustomerID":"ALFKI","OriginalCustomerID":"ALFKI","CompanyName":"Alfreds Futterkiste","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":{},"PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"},

{

"CustomerID":"ANATR","OriginalCustomerID":"ANATR","CompanyName":"Ana Trujillo Emparedados y helados","ContactName":"Ana Trujillo","ContactTitle":"Owner","Address":"Avda. de la Constitución 2222","City":"México D.F.","Region":{},"PostalCode":"05021","Country":"Mexico","Phone":"(5) 555-4729","Fax":"(5) 555-3745"},

{

"CustomerID":"ANTON","OriginalCustomerID":"ANTON","CompanyName":"Antonio Moreno Taquería","ContactName":"Antonio Moreno","ContactTitle":"Owner","Address":"Mataderos 2312","City":"México D.F.","Region":{},"PostalCode":"05023","Country":"Mexico","Phone":"(5) 555-3932","Fax":{}},

{

"CustomerID":"AROUT","OriginalCustomerID":"AROUT","CompanyName":"Around the Horn","ContactName":"Thomas Hardy","ContactTitle":"Sales Representative","Address":"120 Hanover Sq.","City":"London","Region":{},"PostalCode":"WA1 1DP","Country":"UK","Phone":"(171) 555-7788","Fax":"(171) 555-6750"},

{

"CustomerID":"BERGS","OriginalCustomerID":"BERGS","CompanyName":"Berglunds snabbk?p","ContactName":"Christina Berglund","ContactTitle":"Order Administrator","Address":"Berguvsv?gen 8","City":"Lule?","Region":{},"PostalCode":"S-958 22","Country":"Sweden","Phone":"0921-12 34 65","Fax":"0921-12 34 67"},

{

"CustomerID":"BLAUS","OriginalCustomerID":"BLAUS","CompanyName":"Blauer See Delikatessen","ContactName":"Hanna Moos","ContactTitle":"Sales Representative","Address":"Forsterstr. 57","City":"Mannheim","Region":{},"PostalCode":"68306","Country":"Germany","Phone":"0621-08460","Fax":"0621-08924"},

{

"CustomerID":"BLONP","OriginalCustomerID":"BLONP","CompanyName":"Blondesddsl père et fils","ContactName":"Frédérique Citeaux","ContactTitle":"Marketing Manager","Address":"24, place Kléber","City":"Strasbourg","Region":{},"PostalCode":"67000","Country":"France","Phone":"88.60.15.31","Fax":"88.60.15.32"},

{

"CustomerID":"BOLID","OriginalCustomerID":"BOLID","CompanyName":"Bólido Comidas preparadas","ContactName":"Martín Sommer","ContactTitle":"Owner","Address":"C/ Araquil, 67","City":"Madrid","Region":{},"PostalCode":"28023","Country":"Spain","Phone":"(91) 555 22 82","Fax":"(91) 555 91 99"},

{

"CustomerID":"BONAP","OriginalCustomerID":"BONAP","CompanyName":"Bon app\'","ContactName":"Laurence Lebihan","ContactTitle":"Owner","Address":"12, rue des Bouchers","City":"Marseille","Region":{},"PostalCode":"13008","Country":"France","Phone":"91.24.45.40","Fax":"91.24.45.41"},

{

"CustomerID":"BOTTM","OriginalCustomerID":"BOTTM","CompanyName":"Bottom-Dollar Markets","ContactName":"Elizabeth Lincoln","ContactTitle":"Accounting Manager","Address":"23 Tsawassen Blvd.","City":"Tsawassen","Region":"BC","PostalCode":"T2F 8M4","Country":"Canada","Phone":"(604) 555-4729","Fax":"(604) 555-3745"},

{

"CustomerID":"BSBEV","OriginalCustomerID":"BSBEV","CompanyName":"B\'s Beverages","ContactName":"Victoria Ashworth","ContactTitle":"Sales Representative","Address":"Fauntleroy Circus","City":"London","Region":{},"PostalCode":"EC2 5NT","Country":"UK","Phone":"(171) 555-1212","Fax":{}},

{

"CustomerID":"CACTU","OriginalCustomerID":"CACTU","CompanyName":"Cactus Comidas para llevar","ContactName":"Patricio Simpson","ContactTitle":"Sales Agent","Address":"Cerrito 333","City":"Buenos Aires","Region":{},"PostalCode":"1010","Country":"Argentina","Phone":"(1) 135-5555","Fax":"(1) 135-4892"},

{

"CustomerID":"CENTC","OriginalCustomerID":"CENTC","CompanyName":"Centro comercial Moctezuma","ContactName":"Francisco Chang","ContactTitle":"Marketing Manager","Address":"Sierras de Granada 9993","City":"México D.F.","Region":{},"PostalCode":"05022","Country":"Mexico","Phone":"(5) 555-3392","Fax":"(5) 555-7293"},

{

"CustomerID":"CHOPS","OriginalCustomerID":"CHOPS","CompanyName":"Chop-suey Chinese","ContactName":"Yang Wang","ContactTitle":"Owner","Address":"Hauptstr. 29","City":"Bern","Region":{},"PostalCode":"3012","Country":"Switzerland","Phone":"0452-076545","Fax":{}},

{

"CustomerID":"COMMI","OriginalCustomerID":"COMMI","CompanyName":"Comércio Mineiro","ContactName":"Pedro Afonso","ContactTitle":"Sales Associate","Address":"Av. dos Lusíadas, 23","City":"Sao Paulo","Region":"SP","PostalCode":"05432-043","Country":"Brazil","Phone":"(11) 555-7647","Fax":{}},

{

"CustomerID":"CONSH","OriginalCustomerID":"CONSH","CompanyName":"Consolidated Holdings","ContactName":"Elizabeth Brown","ContactTitle":"Sales Representative","Address":"Berkeley Gardens 12 Brewery","City":"London","Region":{},"PostalCode":"WX1 6LT","Country":"UK","Phone":"(171) 555-2282","Fax":"(171) 555-9199"},

{

"CustomerID":"DRACD","OriginalCustomerID":"DRACD","CompanyName":"Drachenblut Delikatessen","ContactName":"Sven Ottlieb","ContactTitle":"Order Administrator","Address":"Walserweg 21","City":"Aachen","Region":{},"PostalCode":"52066","Country":"Germany","Phone":"0241-039123","Fax":"0241-059428"},

{

"CustomerID":"DUMON","OriginalCustomerID":"DUMON","CompanyName":"Du monde entier","ContactName":"Janine Labrune","ContactTitle":"Owner","Address":"67, rue des Cinquante Otages","City":"Nantes","Region":{},"PostalCode":"44000","Country":"France","Phone":"40.67.88.88","Fax":"40.67.89.89"},

{

"CustomerID":"EASTC","OriginalCustomerID":"EASTC","CompanyName":"Eastern Connection","ContactName":"Ann Devon","ContactTitle":"Sales Agent","Address":"35 King George","City":"London","Region":{},"PostalCode":"WX3 6FW","Country":"UK","Phone":"(171) 555-0297","Fax":"(171) 555-3373"},

{

"CustomerID":"ERNSH","OriginalCustomerID":"ERNSH","CompanyName":"Ernst Handel","ContactName":"Roland Mendel","ContactTitle":"Sales Manager","Address":"Kirchgasse 6","City":"Graz","Region":{},"PostalCode":"8010","Country":"Austria","Phone":"7675-3425","Fax":"7675-3426"},

{

"CustomerID":"FAMIA","OriginalCustomerID":"FAMIA","CompanyName":"Familia Arquibaldo","ContactName":"Aria Cruz","ContactTitle":"Marketing Assistant","Address":"Rua Orós, 92","City":"Sao Paulo","Region":"SP","PostalCode":"05442-030","Country":"Brazil","Phone":"(11) 555-9857","Fax":{}},

{

"CustomerID":"FISSA","OriginalCustomerID":"FISSA","CompanyName":"FISSA Fabrica Inter. Salchichas S.A.","ContactName":"Diego Roel","ContactTitle":"Accounting Manager","Address":"C/ Moralzarzal, 86","City":"Madrid","Region":{},"PostalCode":"28034","Country":"Spain","Phone":"(91) 555 94 44","Fax":"(91) 555 55 93"},

{

"CustomerID":"FOLIG","OriginalCustomerID":"FOLIG","CompanyName":"Folies gourmandes","ContactName":"Martine Rancé","ContactTitle":"Assistant Sales Agent","Address":"184, chaussée de Tournai","City":"Lille","Region":{},"PostalCode":"59000","Country":"France","Phone":"20.16.10.16","Fax":"20.16.10.17"},

{

"CustomerID":"FOLKO","OriginalCustomerID":"FOLKO","CompanyName":"Folk och f? HB","ContactName":"Maria Larsson","ContactTitle":"Owner","Address":"?kergatan 24","City":"Br?cke","Region":{},"PostalCode":"S-844 67","Country":"Sweden","Phone":"0695-34 67 21","Fax":{}},

{

"CustomerID":"FRANK","OriginalCustomerID":"FRANK","CompanyName":"Frankenversand","ContactName":"Peter Franken","ContactTitle":"Marketing Manager","Address":"Berliner Platz 43","City":"München","Region":{},"PostalCode":"80805","Country":"Germany","Phone":"089-0877310","Fax":"089-0877451"},

{

"CustomerID":"FRANR","OriginalCustomerID":"FRANR","CompanyName":"France restauration","ContactName":"Carine Schmitt","ContactTitle":"Marketing Manager","Address":"54, rue Royale","City":"Nantes","Region":{},"PostalCode":"44000","Country":"France","Phone":"40.32.21.21","Fax":"40.32.21.20"}

]

)

]]>

</initialData>

</dataSource>

<listView id=

"ListView1" itemCssClass="listItemCssClass"

itemTemplateParentElementId=

"ListView1_layoutTemplate"

alternatingItemCssClass=

"alternatingListItemCssClass">

<bindings>

<binding dataContext=

"view" dataPath="filteredData"

property=

"data"/>

</bindings>

<layoutTemplate>

<template layoutElement=

"ListView1_layoutTemplate"/>

</layoutTemplate>

<itemTemplate>

<template layoutElement=

"ListView1_itemTemplate">

<label id=

"CustomerID">

<bindings>

<binding dataPath=

"CustomerID" property="text"/>

</bindings>

</label>

<label id=

"CompanyName">

<bindings>

<binding dataPath=

"CompanyName" property="text"/>

</bindings>

</label>

<label id=

"ContactName">

<bindings>

<binding dataPath=

"ContactName" property="text"/>

</bindings>

</label>

<label id=

"ContactTitle">

<bindings>

<binding dataPath=

"ContactTitle" property="text"/>

</bindings>

</label>

<label id=

"Address">

<bindings>

<binding dataPath=

"Address" property="text"/>

</bindings>

</label>

<label id=

"Region">

<bindings>

<binding dataPath=

"Region" property="text"/>

</bindings>

</label>

<label id=

"PostalCode">

<bindings>

<binding dataPath=

"PostalCode" property="text"/>

</bindings>

</label>

<label id=

"Country">

<bindings>

<binding dataPath=

"Country" property="text"/>

</bindings>

</label>

<label id=

"Phone">

<bindings>

<binding dataPath=

"Phone" property="text"/>

</bindings>

</label>

<label id=

"Fax">

<bindings>

<binding dataPath=

"Fax" property="text"/>

</bindings>

</label>

</template>

</itemTemplate>

<emptyTemplate>

<template layoutElement=

"ListView1_emptyTemplate" />

</emptyTemplate>

</listView>

<dataView id=

"view" pageSize="10">

<bindings>

<binding dataContext=

"customersDataSource"

dataPath=

"data" property="data" />

</bindings>

</dataView>

<dataNavigator id=

"pageNavigator" dataView="view"/>

<button id=

"previousPageButton" parent="pageNavigator" command="previousPage">

<bindings>

<binding property=

"enabled" dataPath="hasPreviousPage"/>

</bindings>

</button>

<label id=

"pageIndexLabel" parent="pageNavigator">

<bindings>

<binding property=

"text" dataPath="pageIndex" transform="Add"/>

</bindings>

</label>

<label id=

"pageCountLabel" parent="pageNavigator">

<bindings>

<binding property=

"text" dataPath="pageCount"/>

</bindings>

</label>

<button id=

"nextPageButton" parent="pageNavigator" command="nextPAGE">

<bindings>

<binding property=

"enabled" dataPath="hasNextPage"/>

</bindings>

</button>

<button id=

"firstPageButton" parent="pageNavigator" command="FIRSTPage">

</button>

<button id=

"lastPageButton" parent="pageNavigator" command="lastpage">

</button>

</components>

</page>

</script>

</

body>

</

html>

hello.

well, i wouldn't say that it's a lot slower...i'd say that with listview you're seeing it being rendered as it's being generated (though in my machine it looks like it's rendering 4 rows at a time). when you use the panel, everything is replaced at once and i think that is why you don't seen it being rendered...


Hi Luis,

in a normal sample you would have to add the time to retrieve the data.

Here render 5 rows at a time by design, but just to render 5 rows take longer than the update panel to connect to the server and render the 10 rows. you call that not slow.

i think the problem it′s with the templates, if you override the render method of the listview control and build table dinamically, it works like a champ.

what make me suspicious is the lack of any information regarding tabular data and tables in the Atlas docs, also there is not substitute for the gridview control what is the most important ASP.NET databound control.

Please, can some one in the Atlas team explain the plans about this matter


hello again.

hum...interesting...the only thing i'm seeing here is that it renders 4 rows at a time, but those 4 rows are rendered as a block (ie, they all appear at the same time). that's why i said it wasn't slow...

Wednesday, March 21, 2012

Loading Controls usning Ajax after loading the main page

I saw this technique on some pages. The point is that my page is loading very slow due to many user controls on it. Would it be possible to load the page first without the user controls and than load the controls, maybe via Ajax invocation (Update Progress). Any idea how to acomplish this? Any samples?

See this

http://mattberseth.com/blog/2007/06/aspnet_ajax_canceling_an_async_1.html


That is not what I was looking for. This is the INITIAL load page process I am talking about. I want to load the whole page first, but without the controls (those take long to load). After the page loads, I want to automaticly execute loading of controls in Ajax manner (with Update Progress)...


I'm interested in hearing options for something of this kind as well.

For my situation, Im communicating to a workflow, which feeds me a collection of controls to be rendered on the page. However, I can not get the collection until an event is handled from the workflow. At present, this means I have to make two round trips for the whole page in order to render the controls handed to the page.

I have attempted triggering a partial page update, but with out any luck in getting the controls to render.


Hi,

This is what you need:Start callback immediately after page loaded

For more information about this topic,seeDelaying Content Load using Timer and UpdatePanel ANDControlling visibility of contents of collapsiblepanel

Best Regards,


Thanks a lot! This is exactly what I was looking for! I like the solution with Update Panel and Timer, as it seems the most "clean" for me:http://smarx.com/posts/delayed-load-with-an-updatepanel.aspx

I will send you the link to the page once I done coding. Excellent!


Ok, I have implemented this on my websitewww.zikbay,com. It is loading Featured panel data as delayed using Ajax Timer technique. I have realized also more use for the Ajax Timer control :)

I have also realized there is no point in having modal progress dialog. It is as good as the old Postback, just little faster and looks much nicer. But the user still losses the possibility to interact with the page when the data is loading... I guess that was the reason why ASP>NET AJAX team removed it after Beta:) I was always wondering why would they remove it. I gues they did not want people to start using it by default:)


Delayed is not working correctly if I place it on my master page (for the location control) and than run search page (with grid). I think this has something to do with this mix: AjaxTimer (master)+Updates Panel (master + search page)+ Griodview...

This is the message I am getting:

"Too many users connected to server"


Thanks for providing linkSmile

It will really helpful to me & other people


So do you guys think it makes sense to use modal update progress? I see they use it on codeplex all over? Yet for example google is not using it... I thought to use it maybe little against the whole Ajax idea of allowing the user to interact while the page is loading. wonder what your opinions are on this one...

Loading Slow Controls Just Liek PAGEFLAKES

HELP !! I am in the process of roughing together a new web app for my company, and we will have controls that take ages to fetch the data. What I would really like to do is to have something like the pageflakes site which tells you that its loading the page, then the framework and then the controls. I can see how they do the page and the frame work, but I just can't work out how its done, as when ever I try to do it I just get a whole pageupdate, rather than indvidual controls.

Can anybody point me to some resources that could help me work this out?

Alixx

This is something I am looking to do also. I have a few usercontrols that create charts and its takes maybe 8 seconds to retrieve the data from a complex Stored Procedure.

I have a asp:placeholder on the page that loads up the user control, I dont know how to just display the page quickly and then just show an atlas:updateProgress control to indicate that the usercontrol is loading in.

Any ideas? I have tried putting the code that loads the usercontrol into the page.loadComplete event but I am not getting the behaviour I am looking for.


I haven't actually tried this but what I would do is hook into the Sys.Application.load event (or create a pageLoad() function) see:
http://atlas.asp.net/docs/Client/Sys/_Application/E_load.aspx

Then within the Javascript function I would do a PostBack call using the following:
http://atlas.asp.net/docs/Client/Sys.WebForms/PostBackAction/default.aspx

Then all you would need on your aspx page would be an updatepanel around your placeholder and define an UpdateProgress control on you page.

HTH,
Perry

P.S. This is not how PageFlakes does it. PageFlakes uses pure client side controls


Hi guys,

I implemented something similer in my web site.

http://www.smartscoreboard.com

It's all implemented using the lates ATLAS relese. If you are interset in how to implement the loading controls shot me anemail.