Hi Darrel,
You can use the Cache object:
Cache("MyString") = "Test String"
Now, whenever you use Cache("MyString"), it will return the value. If this
is different for each user then use Session() instead of Cache(). One thing
to be aware of is that a Cache("whatever") variable can expire at any time.
So you should always check it for Nothing and re-create it if that happens.
The best way to do this is to encapsulate the Cache object in your own
class. Then use that classes properties and have those properties reference
the Cache object. In those properties test for Nothing and if it Is Nothing
then put the logic in there to re-create it. Good luck! Ken.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"Darrel" <no*****@nospam.com> wrote in message
news:u0*************@TK2MSFTNGP10.phx.gbl...
I'm dimming a string at the top of my page so I can use it in several
different subs on the page.
I'm setting the text in one sub and then reading it in several. I'd like
to also use this varable on postback. The catch is, since I'm dimming it at
the top of the page, it resets itself on postback.
The fix I cam up with is to, on page load, populate a hidden field with
the value I want, then read that back on postback. But is there a more
elegant/straightforward way to achieve this?
-Darrel