the best way to have some information accessable to all pages?

Discussion in 'ASP .Net' started by Annie, Sep 7, 2005.

  1. Annie

    Annie Guest

    hello all,

    I need to have access to some details in all my pages eg a Person object.

    what is the best way to do it?
    store in session object? or pass them through the QueryString or Application
    variables etc?

    what is the best and efficient way?
     
    Annie, Sep 7, 2005
    #1
    1. Advertising

  2. It really depends on the nature of the application. Overall, I am not fond of
    putting everything in hidden tags so it can travel on the Query String. It
    potentially opens security holes.

    Where you store information depends on the nature of the information.

    If it is linked to the user, cookies are an option. For security, you can
    send the user's token instead, or link it to the session ID. This will
    require grabbing the information with each return, but it is safer than
    storing in the cookie.

    For session specific information, you can use the Session object as a cache.
    You can also use the cache manager functionality of ASP.NET.

    For page specific information (like the Person object is the person being
    worked on, not the person using the app), you can use ViewState.

    As I stated at the beginning, it really depends on the nature of the
    application.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************


    "Annie" wrote:

    > hello all,
    >
    > I need to have access to some details in all my pages eg a Person object.
    >
    > what is the best way to do it?
    > store in session object? or pass them through the QueryString or Application
    > variables etc?
    >
    > what is the best and efficient way?
    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Sep 7, 2005
    #2
    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. Dominic
    Replies:
    0
    Views:
    437
    Dominic
    Nov 3, 2004
  2. Eric Sabine
    Replies:
    3
    Views:
    433
    =?Utf-8?B?U2hhdw==?=
    Jan 28, 2005
  3. Bruce Hodge
    Replies:
    0
    Views:
    425
    Bruce Hodge
    Feb 15, 2006
  4. Jim Walseth
    Replies:
    0
    Views:
    301
    Jim Walseth
    Oct 23, 2003
  5. william

    web service is not accessable

    william, Nov 16, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    113
    william
    Nov 16, 2007
Loading...

Share This Page