views:

580

answers:

1

Currently we have a set of form controls that do post backs and we decided to get some "free" user experience by wrapping them in an update panel. The controls store data in the session state for that user so that we don't have to constantly request data from our platform.

When doing WebMethods and WebService calls if we want to make use of the session we have to set the EnableSession property to be true if we want to access the session. Since update panels also do the same thing, where is the proper place to put the WebMethod/EnableSession attribute so that requests made from the update panel have access to the session?

Thanks.

A: 

Wouldn't you put it on whatever event is associated with your updatepanel's trigger?

Jack Marchetti
The problem is that the button that triggers the post back is part of the control. I don't have access to go into that control and change the method in it to be a WebMethod with the EnableSession=true attribute.
Victor
I was also under the assumption that UpdatePanels aren't specifically calling a method, but more of executing a whole life page cycle asynchronously, so technically what happens that could change the information in an update panel isn't one specific method.
Victor
Well you can associate specific triggers for an updatepanel.So if you had a button which would cause the update panel to change, you would add that button id as the trigger for the updatepanel. You would have to set Updatemode = "conditional" on your updatepanel as well.
Jack Marchetti
The issue wasn't triggering the post back, the issue was to have the post back have access to the current session information. For example the control is a data entry form, and when the user clicks save, we store the information into our platform DB, and into the user's session data to allow for faster processing. The problem is, is that when using an update panel, the post back doesn't have the same session information.
Victor

related questions