Re: Session variables problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: bruce barker (nospam_brubar_at_safeco.com)
Date: 12/01/04


Date: Wed, 1 Dec 2004 09:44:04 -0800

you can store the query data in session in a keyed collection. just store
the key in the url or viewstate

-- bruce (sqlwork.com)

"Simon Matthews" <SimonMatthews@discussions.microsoft.com> wrote in message
news:A935A4AB-6BF9-436A-9C24-C68BF625F179@microsoft.com...
| I am having issues with the right way to architecture the following (using
c#
| asp.net):-
|
| The question I have is how best pass the collected data from one web page
| for use in another.
|
| The question I have is how best pass the search criteria from the first
page
| to the second. The search criteria exists as a structure and is filled
when
| the user presses the 'Search' button on the first page.
|
| 1. Present an asp page for collecting user search criteria
| 2. Show grid with results of search after querying SQL
|
|
|
| If I use the session to store it, then this causes problems as the session
| variable is overwritten on a second search by the user, but a couple of
| presses on the back button of the browser will get you to a page expecting
| different criteria in the session from earlier which is no longer there.
|
| ViewState seems no good as it only works on postback and the above issue
| would still cause a problem.
|
| I do not want to pass the search criteria in the address line as this is
| messy and allows the user to change and view it.
|
| I beleive you can also use Server.Transfer but I think this would have a
| similiar issue with the data being available long-term.
|
| Any pointers as to the correct approach to this would be most welcome.



Relevant Pages

  • Re: ViewState, Application, Session....
    ... viewstate and as a part of Request pipeline the framework initializes the ... Session: Session is a storage area that is specific to one user. ... there are times when session provides a good way to store user specific ... Application or Cache: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: using Session-object ??
    ... To store it in ViewState, ... Session, it must be serializable if you are using anything other then ... What you can do, is get the object array in the ItemArray property, and ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: problem in the dataset
    ... Two possible places to store the dataset are in the viewstate or in the ... You could also store the information in the session, ... The basic idea is that you load the data on page load and immediately ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem with paging in datagrid
    ... But viewstate is the place for Asp.net WebForm to store ... > a place to store some information, session is a good place for this. ... the main point of my sample code is the algorithm to calculate the ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: Session variables problem
    ... If I key it into the session I suppose I would need to get rid of them ... I'm not sure I understand the viewstate properly, it only seems to get set ... so on the second page the first time it loads the vieewstate ... The search criteria exists as a structure and is filled ...
    (microsoft.public.dotnet.framework.aspnet)