Best way to keep a hidden value?

Discussion in 'ASP .Net' started by Bruce W..1, Dec 9, 2003.

  1. Bruce W..1

    Bruce W..1 Guest

    What's the best way to keep a hidden value? It doesn't need encryption or any protection.

    I realize that I could use a Label control's viewstate, and just make it not visible, but
    that doesn't seem efficient. Or I could use a session variable, or a cookie...

    To simply hide a simple value in a page, what's the best way to do this?

    Thanks for your help.
     
    Bruce W..1, Dec 9, 2003
    #1
    1. Advertising

  2. Bruce W..1

    Suresh Guest

    Hidden ASP.NET or HTML server side objects are fine for
    keeping hidden values in a page.

    HTH,
    Suresh.

    >-----Original Message-----
    >What's the best way to keep a hidden value? It doesn't

    need encryption or any protection.
    >
    >I realize that I could use a Label control's viewstate,

    and just make it not visible, but
    >that doesn't seem efficient. Or I could use a session

    variable, or a cookie...
    >
    >To simply hide a simple value in a page, what's the best

    way to do this?
    >
    >Thanks for your help.
    >.
    >
     
    Suresh, Dec 9, 2003
    #2
    1. Advertising

  3. If you are not going to set or alter this using client script then the best
    way is to store it into the page ViewState
    eg Viewstate["somename"] = "Joe";

    "Bruce W..1" <> wrote in message
    news:...
    > What's the best way to keep a hidden value? It doesn't need encryption or

    any protection.
    >
    > I realize that I could use a Label control's viewstate, and just make it

    not visible, but
    > that doesn't seem efficient. Or I could use a session variable, or a

    cookie...
    >
    > To simply hide a simple value in a page, what's the best way to do this?
    >
    > Thanks for your help.
     
    Andrew de la Harpe, Dec 9, 2003
    #3
  4. Bruce W..1

    Scott M. Guest

    Just add your name/value pair into the State Bag (ViewState). No control
    necessary, no server memory used up (Session).

    ViewState.Add("Key", "Value")


    "Bruce W..1" <> wrote in message
    news:...
    > What's the best way to keep a hidden value? It doesn't need encryption or

    any protection.
    >
    > I realize that I could use a Label control's viewstate, and just make it

    not visible, but
    > that doesn't seem efficient. Or I could use a session variable, or a

    cookie...
    >
    > To simply hide a simple value in a page, what's the best way to do this?
    >
    > Thanks for your help.
     
    Scott M., Dec 10, 2003
    #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. phl
    Replies:
    1
    Views:
    449
    Rajesh CKR
    May 3, 2006
  2. =?Utf-8?B?cGF0cmlja2RyZA==?=

    best way to keep persistence of a dataset?

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Feb 1, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    546
    MasterGaurav \(www.edujini-labs.com\)
    Mar 1, 2007
  3. Rick
    Replies:
    3
    Views:
    8,597
    Alexey Smirnov
    Apr 13, 2010
  4. Edward J. Stembler

    Best way to keep track of user-related info? [Opinions wanted]

    Edward J. Stembler, Nov 13, 2003, in forum: ASP .Net Security
    Replies:
    1
    Views:
    143
    Edward J. Stembler
    Nov 13, 2003
  5. oldyork90
    Replies:
    1
    Views:
    183
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page