This is a migrated thread and some comments may be shown as answers.

AjaxManager partial postback too slow for users/storing data in session. Can I manipulate/maintain data completely on client-side? Can i submit grid data like a form?

1 Answer 72 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 2
Matthew asked on 11 Jun 2009, 01:17 AM
Hello Folks,

I'm currently using a "shopping cart" type application we use to make purchases in-house via bank card and contract. The users pick from a parts-list that is populated via client-side loading with a webservice, so there isnt much speed hitch there.

I Store a List<SomeSimpleCustomClassWithBasicProperties> in the session variable to keep the user's "cart" during any Ajax operations.

Any partial postback takes a ~1-1.5 second lag total round trip for the post, waiting, and then re-render. This is OK for adding parts to the list as it doesn't really interfere with how the user is using the application.

For the "cart"-side of the application page, users can pick different manufacturers/vendors to order from, and also change quantity and ordering within the "cart" (this looks and works alot like the netflix my queue page for an example)

My problem is that when the user is quickly entering a set of quantities, the delays while the partial postback is happening can be prohibitive.

I'm searching for a way to keep the "cart" between actions but without having to rely on direct server re-renders. I don't mind if this takes extensive javascript to work. I've been using jquery where possible so if any solutions can be done with that, I'm definately interested.

Basically, is there a way I can update the "cart" on the client side while simultaniously passing a message back to the server to update the session variable, without having to wait for a partial postback?

Alternatively, can I only manipulate it on the client, and then "submit" the contents (via JSON data or some other way) when the user does a postback/ajax request?

Basically the user manipulates the grid untill he clicks "save", "print" , "submit" or similar actions, at which I need to pass the data back to the server and perform validation. I'm currently setting up visual studio and etc at home and will try and post a sample of essentially what I am doing.

But, I guess Im trying to manipulate and edit a grid that was curretnly bound to a List<> in my session, and I want to do all that client-side without partial postbacks.

I'm finishing a huge project that otherwise works great (with telerik) at a reasonable sized organization and this is really the one part that seems that it could use a bit of improvement.


1 Answer, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 16 Jun 2009, 08:27 AM
Generally speaking it is hard to suggest optimization in cases like yours without more detailed information about which are the controls and how they are composed and used on the page. However from the description you have given  I suppose you may find this online example useful. You may check also RadGrid's client-side databinding examples too.

http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx

--Bruno




Tags
Ajax
Asked by
Matthew
Top achievements
Rank 2
Answers by
Bruno
Top achievements
Rank 2
Share this question
or