using viewstate works the same way. with viewstate the data is serialized to
viewstate, in onload viewstate, its deserialized, then databound.
you can store the data in session and rebind from it in oninit, but if you
use sqlserver session, then the requery may be a good option. if if inproc,
you ay want to do the query to save memory load on the server.
-- bruce (sqlwork.com)
> Hi,
>
[quoted text clipped - 21 lines]
> Thanks a lot for any hints in advance! Regards
> DC
DC - 11 Feb 2008 17:54 GMT
On 8 Feb., 17:23, bruce barker <brucebar...@discussions.microsoft.com>
wrote:
> using viewstate works the same way. with viewstate the data is serialized to
> viewstate, in onload viewstate, its deserialized, then databound.
[quoted text clipped - 32 lines]
>
> - Zitierten Text anzeigen -
Thank you, Bruce. I tried to use viewstate, trading more transfer
(about 50 - 100K per request in my scenario) for the additional trip
to the database. However, I cannot get it to work. I am creating
columns dynamically, so I made sure to have the gridview set up before
viewstate loads (in OnInit). But still my result is an empty grid
after postback (empty datafields, but the rows and cols are there).
So I am still going to the DB twice for every request, and the first
DB query runs only for the recreation of the table state which is only
required to make events work. If I could hardwire the events (so the
recreted control would not be used) then I could avoid the seconds
call. But the only way of "hard wiring" I know is an ordinary anchor
and url parsing, which is impossible in my scenario since the gridview
also resides in an asp.net ajax updatepanel...
Regards
DC