Sorry another newbie post here...
Is it possible to store an Object against a page between form Posts?
ViewState will only take a string .. are there any other .. ways of storing the object or do I need a typeconverter of some sort?
Printable View
Sorry another newbie post here...
Is it possible to store an Object against a page between form Posts?
ViewState will only take a string .. are there any other .. ways of storing the object or do I need a typeconverter of some sort?
Absolutely!
All you have to do is to cast the object back when you need it:
Code:ViewState["yourObject"] = yourObject;
...to read
YourObjectType yourObject = (YourObjectType)ViewState["yourObject"];
Thanks Serge!
Just for the record, the typecasting in VBScript is:
Unfortunately the object I'm handling is not Serializable - I think that is my next job ... ;)Code:myObject = DirectCast(viewstate("myObject"), myObjectType)
Cheers,
Tim