Peter's Gekko

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
A sip from the webhose

Just back from the double session by Nikhil Kothari on creating web server controls. He's absolutely the ultimate geek, the amount of really good and deep code he can pour out over his audience is unprecedented. As he is a very good and clear coder : he's one of the authors of the beautifull written MS book "Creating web server controls and componenets". There is a lot of techinical details of asp.net web pages you can learn from sessions like this. It will take me days to destill everything from the samples, but there are two things I would like to present here :

In Whidbey web controls have, beside the viewstate, a controlstate property. It is a light weigth container for data which is stored in the viewstate and cannot be switched off. A control should use it to store those properties whose state should allways be preserved over roundtrips for the control to work properly. A typical example is the SelectedItemIndex in a datagrid. For this to work in 1.x you have to set the grid's viewstate to on. Which leads to all data in the grid also ending up in the viewstate. Which is an enormous waste on the wire if you reload the data on every roundtip, like in a grid to edit database data. In Whidbey you can switch of the viewstate and still have your selectedindex. Great !

Another new thing in the Whidbey is the callback, which works side by side with the postback. A callback does go back to the server but does not lead to a full page rebuild in the browser. How it all works is pretty complicated but the user experience is that you see spellingchecks being performed on the server while you are typing in the browser. Pretty amazing. Who said that a browser is just a "poor" client ?


Posted 10-30-2003 12:44 AM by pvanooijen

[Advertisement]

Add a Comment

(required)  
(optional)
(required)  
Remember Me?