Best way to keep a hidden value?

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.
 
S

Suresh

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
 
A

Andrew de la Harpe

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";
 
S

Scott M.

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

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,835
Latest member
lila30

Latest Threads

Top