I am sure everyone who programmed with user controls for asp.net came across situations where you needed a certain way to check whether a user control has been loaded for the first time or it has been re-loaded. Has anyone come up with any other solutions other than setting hidden “currentOpenControl” flag(s). If you are wondering as to do I need to check whether control is open for first time or re-open again, then one of the big reasons is databinding. When the control is open for first time, that is when I want to databind, afterwards on re-open, if I databind again I will lose any changes user might have added.
So I am just wondering if anyone has a more elegant solution than setting flags whether control is open or not.
Thanks
The only way I’ve ever managed to do this is by using the ViewState…
Or for C#…