Click to See Complete Forum and Search --> : event handler problem vs viewstate null problem


GreenInSpots
December 5th, 2005, 09:21 PM
I've done more windows programming than web programming, so that may be half of my problem.

I thought I'd be clever and create an event handler in one of my user controls so that when the event fired in the control, the main aspx page would know about it and would load a different control(ctrl 2)... data was also transfered between these 2 user controls while the aspx page was loading and unloading these controls.

So ctrl one's event fires and page knows about it and transfers data from ctrl one to ctrl 2. Now ctrl 2 is on the page and everything is right with the world.

But then when the event fires in ctrl 2 the url on the main page was never changed, so the whole page goes back original state and all is lost.

The data I'm trying to pass between these 2 controls is an arraylist that will vary in size.

So when I realized the event handle firing wasn't going to work(or maybe someone out there knows how I could get it to work??)..., I tried storing arraylist in viewstate. But now everytime I call the viewstate it comes back null!!! I know the values are saved to the view state because I saw it happen when I ran it in the debugger.

I'm saving and calling the viewstate in the same aspx page.

I thought viewstate was supposed to persist for the same page.

I lost a whole day working on this and I feel like a fool.

But a fool must persist in his folly, so here I am posting to you wonderful people and hoping someone CAN SEE WHAT I CAN'T!!!!

stardv
December 6th, 2005, 10:18 AM
Post some code for better idea what you are doing