Best way to keep a hidden value?

  • Thread starter Thread starter Bruce W..1
  • Start date Start date
B

Bruce W..1

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.
 
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
 
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";
 
Just add your name/value pair into the State Bag (ViewState). No control
necessary, no server memory used up (Session).

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