Groups | Blog | Home
all groups > asp.net building controls > may 2005 >

asp.net building controls : view state In user control


bhavik
5/1/2005 12:18:02 AM
I just want to know that can I sotred object In view state.
If yes then can I sotred that object In user cntrol (means can user control
support view state Like......)

Viewstate["Obj"]= Obj;


Brock Allen
5/1/2005 6:17:32 AM
Yes you can store objects in ViewState as long as they "allow" it by marking
themselves as Serializable. If they have any child objects as fields, then
those classes also need to be marked as such

[Serializable]
class MyData
{
// ...
}

-Brock
DevelopMentor
http://staff.develop.com/ballen



[quoted text, click to view]


AddThis Social Bookmark Button