i have created a user control UserControl.ascx, in Code behind file of
UserControl.ascx i have created an object of a class MyClass.cs,
objMyClass= new MyClass();
when i click on button of UserControl.ascx page and try to access
objMyClass object then it set as null, so how to persist MyClass object
when page PostBack, i wanted to keep object persist till the user access the page, when user goes out of this page then object should distroy?
To keep the object persist, i have used ViewState
So i have made MyClass Serializable and
i have used ViewState to keep my objet persist, but it give the error
like : UserControl is not marked as serializable.
so i have made my UserControl as Serializable, but the problem is still coming.
One more thing is that MyClass is also resposnsible to create some other class object also.
Can any one suggest me correct solution?
Problem i am getting when i try to PersisObject On UserControl