Why and How to use server side ajax – even you do not like it – part 2
However, it is not at its prime time, yet; its prime time will be after a few months or half a year after Orcas release; as a compromise, at least before Orcas, I have to use C1WebGrid etc., instead of client side ajax controls (the best is ext, and yahoo is also good).
A good example is the C1WebGrid and C1WebDialog. C1WebGrid is not really ajax ready yet (ya, it has canned ajax features; that means almost nothing nowadays!); C1WebDialog is a little better. However, both are marketed as ajax ready. If you believe those marketing hypes for C1WebGrid, then, you will really be disappointed, or, misled, by thinking that “ajax can only so little”. As a result, in such a situation, user developers have to lower their standard, and use postback mostly, and use callback whenever they hit one by chance and luck. Note that some marketing materials lead you believe that update panel does not use postback. That is not true. Update panel uses postback. As a result, if it is not client side API, it uses postback, even it is not the whole page postback. As a result, we need to talk about how to do Postback or updatePanel in a way to limit their damages.
Updatepanel postback is still bad, comparing with real client side API call back, for two reasons: (a) Postback always invokes the whole machinery of postback, so, it is bad for performance hit. However, this part of it is not big deal for us, because its damage is only performance, as long as it is fast enough for users, we are fine. (b) More importantly, a lot of times, postback has to use a twisted way to do things. For example, the "multi-value selection shuttling grid pairs": you have two grids, the left or top grid, and the right or bottom grid; the left one is for the available, the right one is for the selected; so, you do the selection by move a row from the left to the right. The selection action is a pure client side thing, until you click “submit selections” button. However, postback makes this a server side operation. Worse, sometimes, to make things perform better, you have to create a workaround on the UI: you put a checkbox on each row, and let users select a few rows, then, click a “select” button ( but this select button is not the “submit selections” – the reason is that there is paging on the available grid – that is actually the reason why we need to shuttle the selected one to a new grid) – the whole thing is getting more and more confusing when you try to put more and more workarounds.
I believe we have a few options:
(i) Find those workarounds;
(ii) Say no to users;
(iii) Buy more new controls, for example, a shuttle control. You will need perhaps a dozen of controls. This has two sides:
In short, here is the summary:
(a) For now, for some old so-called ajax-enabled server side controls, most of the time, we have to use postback/updatePanel, insteald of real callbacks;
Below are the notes that I study the user manual of C1WebGrid.
Note: You must create a ComponentOne Account and register your product with a valid serial number to obtain
support using some of the above methods.
The ComponentOne Studio for ASP.NET 2.0 installation program will create the directory C:\Program
Files\ComponentOne Studio.NET 2.0. This directory contains the following subdirectories:
bin Contains copies of all ComponentOne binaries (DLLs, EXEs).
Common Contains support and data files that are used by many of the demo
Help Contains online documentation for all Studio components.
C1WebGrid Contains samples for C1WebGrid.
Select the ComponentOne C1WebGrid assembly from the list on the .NET tab or browse to find the
C1.Web.C1WebGrid.2.dll file and click OK.
• an assembly resource file which contains the actual run-time license (host dll or for asp 2.0 App_Licenses.dll assembly)
• a "licenses.licx" file that contains the licensed component strong name and version information (Show All Files on the Project menu) ---- to add the file, add the control to the form (then, can delete the control)
Right-click C1WebGrid and select Show Smart Tag from the context menu. Select Property builder from
the C1WebGrid Tasks menu.
1. Select the C1WebGrid component.
2. Select Properties Window from the View menu on the Visual Studio toolbar.
1. Right-click C1WebGrid and select Auto Format from the context menu. The Auto Format dialog box opens.