How to capture a page state in ASP.NET?

  • Thread starter Thread starter Maziar Aflatoun
  • Start date Start date
M

Maziar Aflatoun

Hi everyone,

I'm interested to know if it's possible to capture a web page state in
ASP.NET so that you can come back to it. For example, I have a Datagrid
with sort turned on individual columns. This Datagrid displays Company
Addresses. Now lets say the user click on Sort Datagrid by Contact Person
and so the Datagrid refreshes itself sorting by Contact Person. Next, user
clicks on a single row where he/she is able to edit the contents of that row
(Different page). Is it possible to somehow store the page state which
includes my Datagrid and possibly additional textboxes...etc. and return the
user back from the edit page or any other page to the original page with
same exact page as they left it? (Sort datagrid and populate textbox...etc.)

Thank you
Maziar A.
 
Maziar,

The only way I can think of doing this, is by storing all the information in
Session. And then, on a page load, check your session variables to see if
they have any data and repopulate the form how it should. However, since
Session is most commonly stored in Memory, there is a good possibility with
the growth of your application, that you'll run out of memory on the
server...which is bad.

The only real way I see doing something of this sort, is to store the state
(upon each load) into a SQL server, and store just a pointer/PK reference to
that state information in session.

Does this make sense?

HTH,
Matt Hawley, MCAD .NET
http://www.eworldui.net
 
Back
Top