views:

716

answers:

2

I have user control on a ASP.NET web page, which contains a GridView and a radio button selector.

In the underlying middle tier I have a thread which goes to the database and then raises an event to say "I have some data" my User control handles this event and sets a Session Variable.

This works and I can see the event being handled and the Session variable gets the new data.

However when i go to use this session variable when the selected index of the Radio button selector changes the Session variable reports as "Nothing"

I have ensured that the obvious (i.e. spelling, Sessions switched on etc) are correct.

The GridView and radio button selector are encapsulated in the same Update panel.

+2  A: 

Check that if your UpdatePanel - updatemode is set to 'Conditional'? also Child as triggers? I would first start by putting a stop in your page load, see whats happening from there. Do a search for all places where you populate that session variable and put a stop. You may be surprised, I have often found that page lifecycle gets confusing even though I thought I understood it. Alt - post some code and we can step through.

JamesM
A: 

Yeah, sounds almost like a problem with order of operations or not checking for postback on a page load or something?

Like JamesM suggested, running your website in debug mode should really help identify the problem. You can bring up your watch window and set it for the Session variable you're looking for, then set breakpoints all over and check the value at each stop to divide and conquer the code.

Mxyzptlk