State managment

Discussion in 'ASP .Net' started by Vik, Feb 3, 2004.

  1. Vik

    Vik Guest

    A Web page contains a search function, which fills out a dataset and stores
    it in a Session state. A user can navigate through the stored records. If
    the user opens a new browser window from the existing one and enters another
    search criteria, then the new dataset overrides the dataset from the
    previous window in the session state and both windows display the same
    results though the search criteria look different.
    When the dataset is stored in a view state loading the page takes forever.

    How can I solve this problem? Should I retrieve data from a database every
    time the page is loaded?

    Thanks.
    Vik, Feb 3, 2004
    #1
    1. Advertising

  2. Vik

    Marina Guest

    If these are your requirements, then yes. At any one time, you should only
    retrieve the records you need though. So if you are display 10 at a time,
    grab 1-10 the first time, when they hit Next, grab the next 10.

    The other way you could do it, is to assign each page a new GUID on the
    first page_load and store the GUID in viewstate. Then, if your session
    variable name is "SearchResults", name it : GUID + "SearchResults". That
    way there will be unique session variables for each page, since each one
    will have a unique guid that it has created at start up. This works if you
    don't mind having multiple sets of data in session at the same time.

    "Vik" <viktorum@==hotmail.com==> wrote in message
    news:...
    > A Web page contains a search function, which fills out a dataset and

    stores
    > it in a Session state. A user can navigate through the stored records. If
    > the user opens a new browser window from the existing one and enters

    another
    > search criteria, then the new dataset overrides the dataset from the
    > previous window in the session state and both windows display the same
    > results though the search criteria look different.
    > When the dataset is stored in a view state loading the page takes forever.
    >
    > How can I solve this problem? Should I retrieve data from a database every
    > time the page is loaded?
    >
    > Thanks.
    >
    >
    Marina, Feb 3, 2004
    #2
    1. Advertising

  3. Vik

    Vik Guest

    Thank you.

    I already tried assigning PageID = Now. This works if a user opens the new
    window before the page is posted back. After the page is posted back opening
    the new window does not call Page_Load procedure, so PageID remains the same
    as on the first page.

    Vik

    "Marina" <> wrote in message
    news:%...
    > If these are your requirements, then yes. At any one time, you should

    only
    > retrieve the records you need though. So if you are display 10 at a time,
    > grab 1-10 the first time, when they hit Next, grab the next 10.
    >
    > The other way you could do it, is to assign each page a new GUID on the
    > first page_load and store the GUID in viewstate. Then, if your session
    > variable name is "SearchResults", name it : GUID + "SearchResults". That
    > way there will be unique session variables for each page, since each one
    > will have a unique guid that it has created at start up. This works if

    you
    > don't mind having multiple sets of data in session at the same time.
    >
    > "Vik" <viktorum@==hotmail.com==> wrote in message
    > news:...
    > > A Web page contains a search function, which fills out a dataset and

    > stores
    > > it in a Session state. A user can navigate through the stored records.

    If
    > > the user opens a new browser window from the existing one and enters

    > another
    > > search criteria, then the new dataset overrides the dataset from the
    > > previous window in the session state and both windows display the same
    > > results though the search criteria look different.
    > > When the dataset is stored in a view state loading the page takes

    forever.
    > >
    > > How can I solve this problem? Should I retrieve data from a database

    every
    > > time the page is loaded?
    > >
    > > Thanks.
    > >
    > >

    >
    >
    Vik, Feb 3, 2004
    #3
  4. Vik

    Tommy Guest

    For each search query, save the results in a file on the applicaton
    server. When the user page through these results, you can just read
    from the file instead of querying the database again.

    With each unqiue search query in a separate file, the user can have
    multiple view of the same data without having to constantly query the
    database.

    You can also have a component running in COM+ under a user that has
    write permissions on the web server to save the files.

    Tommy,

    "Vik" <viktorum@==hotmail.com==> wrote in message news:<>...
    > A Web page contains a search function, which fills out a dataset and stores
    > it in a Session state. A user can navigate through the stored records. If
    > the user opens a new browser window from the existing one and enters another
    > search criteria, then the new dataset overrides the dataset from the
    > previous window in the session state and both windows display the same
    > results though the search criteria look different.
    > When the dataset is stored in a view state loading the page takes forever.
    >
    > How can I solve this problem? Should I retrieve data from a database every
    > time the page is loaded?
    >
    > Thanks.
    Tommy, Feb 4, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    1
    Views:
    333
    Greg Huber
    Apr 14, 2004
  2. Paul Fi
    Replies:
    0
    Views:
    635
    Paul Fi
    Sep 10, 2004
  3. Eirik Eldorsen

    ad managment

    Eirik Eldorsen, Feb 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    403
    Scott Allen
    Feb 7, 2005
  4. lawrence
    Replies:
    11
    Views:
    642
    Long - CM web hosting
    Jun 1, 2004
  5. Clement RAMBACH

    std::vector managment question

    Clement RAMBACH, Feb 26, 2004, in forum: C++
    Replies:
    2
    Views:
    388
    Clement RAMBACH
    Feb 26, 2004
Loading...

Share This Page