datagrid paging and XML

  • Thread starter Thread starter Perre Van Wilrijk
  • Start date Start date
P

Perre Van Wilrijk

Hi,

Just curious.

If you use the pagingsystem delivered with ASP.NET datagrid control ...

will the system access the database each time you ask the next page ...

or will all data be loaded into a hidden XML-file which will be used when
going to the next page.

If XML is the answer then ...

1) is it stored in memory or on disk
2) when will the file be deleted ... considering IIS doesn't know how long a
user will keep the page in his browser.

Thanks a lot.
 
Neither will happen.

You would access your data source in the Page_Load event handler in a Non
Postback section of an IF statement and from that point forward, the
DataGrid data is stored in ViewState.

Yes, you will make a trip to the web server each time a new page of data is
requested, but no, you aren't going back to the database for more data each
time.

Depending on the size of the initial data being brought into ViewState in
the first place, you may find that it makes sense to go back to the data
source on each request for a new page of data, the trade off is that you run
more code and access the data source more often, but you are only storing
small amounts of data on any given page request.
 
Back
Top