views:

308

answers:

3

Hey,

As far as I can tell it is impossible to access the ViewState of a parent page from a popup.

What is the best approach to accomplish passing this information?

I have considered the following:

Using the Session but this may have memory implications on the server.

Passing data in querystring but this may have security implications exposing data and access method in page

Any other ideas or recommendations?

Thanks in advance

A: 

You could store the information in a database and then pass the row ID to the popup window in the query string.

Sean Bright
A: 

Instead of a popup window, you could use a modal overlay (like this: http://malsup.com/jquery/block/#dialog).

Jon Galloway
Thanks for the suggestion, we are using modal overlays elsewhere in the site, but this popup is intended to be visible concurrently with the page an overlay would hide.
Adam Fox
+1  A: 

You don't want to use Viewstate - as that is tied to the parent page and not meant to be passed around.

You can try passing some info via a querystring that has been encrypted. In a sense, this would be equal to what you were trying to accomplish via passing the viewstate. The viewstate is essentially data encrypted within your page - accessible just the same as the querystring.

You could also use cookies, or session as well. If you have memory concerns with using session, I think storing state in a database would be more advantageous.

rifferte
The Session is a great place for this. Cookies are very limited size wise so avoid them for anything but the most basic of details.
Nissan Fan
Great point on the cookie size. I also believe session might be the best fit here as well.
rifferte