currentSession with tabbed browsing

currentSession with tabbed browsing

Old forum URL: forums.lhotka.net/forums/t/1535.aspx


simmonsj_98 posted on Wednesday, October 18, 2006

I ran into the following problem today and was wondering if anyone has thought about a solution for.  My tester was testing the web site in Firefox and had multiple tabs open.  They would go to a page on tab one that placed an object into currentSession, then one tab two try to perform an action that loaded an object from session.  The problem is that the objects are of different types.  I know that I could give each session object a different name, but do not want the user to have to carry all that around.  This is an issue that I’m sure will affect many developers once IE7 comes into wide use.

 

If anyone has any ideas about this please let me know.

 

Thank you.

Jeff

http://www.liquidcognition.com

skagen00 replied on Wednesday, October 18, 2006

I'm nearing a point where I will be needing to do this and this is what I was thinking how I would handle it.

Each open object would get a GUID ticket that would be stored in ViewState of the page(s). Items would be cached by that GUID ticket. If you use a single session variable for a particular page, what happens if you have multiple records open? Can't do it. If I want to edit Joe Blow and Scarlet Johansen at the same time, the variables collide. To me that's a real issue.

Obviously at some point these variables need to expire. I've been considering using the built in ASP.Net Caching but I'm not entirely sure that's the only answer that I'd use.

SonOfPirate replied on Friday, December 22, 2006

Just wondering if anyone has had any luck with this?

I too was concerned about tabbed browsers (esp. w/ IE7 now supporting it) when I saw Rocky's implementation with a single Session key for each page.  In my case, I am using a tab control in my application that allows multiple objects to be "open" at the same time.  So, there's no getting around this for me!

Anyway, I also came up with the idea of assigning a GUID value as the Session key for each page and storing that value in the page's ViewState so that the object can be recovered from Session on post-back.  This works great and when multiple pages are "open" they each key their BO with a unique identifier in Session as planned.  HOWEVER, I am running into a problem where ViewState returns null on post-back!

I have tried everything I can to get this squared away including explicitly enabling ViewState at the Page and UserControl level (even though IsTrackingViewState was already true in both cases). I also looked into using the new ControlState feature but that didn't work either.  I don't know if this has something to do with the FormView and CslaDataSource controls being used in the UserControl or what.  But it is increasingly frustrating to have something that should be a given create so many headaches.

Anyway, if anyone has been successful in implementing this, I'm curious how you accomplished it.

Thx

 

Copyright (c) Marimer LLC