Transfering viewstate from one page to another?

R

Rob Meade

Hi all,

I have an application which enables a user to register and select a series
of resources to go with their profile.

At the moment I have an issue on the section where they will select the
resources, this is done by launching a popup window, displaying the list of
available resources and then the user can select one, in turn this should
then populate the parent window.

My problem is that when I retrieve the list of resources from the database I
only want to display to the user the ones that they have not already
selected, or those that come pre-selected in their role.

In the viewstate I have my own object "UserRegistration" which holds this
detail, so how can I communicate the viewstate from the parent page to the
popup window so that I might instantiate a new UserRegistration object on my
popup?

I would prefer to do something like this as opposed to always returning all
resources as there are quite a few, and in addition, even if I did return
ALL resources, I'd then have to iterate through them and still not display
the ones they have, so I'd still need a method of communicating between the
two windows.

Thanks in advance for any help,

Regards

Rob
 
B

bruce barker

you should use session instead of viewstate and your users will enjoy
quicker pages.

-- bruce (sqlwork.com)
 
R

Rob Meade

...
you should use session instead of viewstate and your users will enjoy
quicker pages.

Hi Bruce,

Thanks for the reply.

Currently the pages are running like lightning, the object in the view state
is not a large one, also, I dont have to worry about them disappearing for
an hour on a coffee break and then coming back to me moaning because they
had to start the registration process again... :eek:)

Users *tut* World on a stick etc etc... :eek:)

Any thoughts on accessing the viewstate from the popup? ie, can it be done?
I read that its all hashed up too which made me wonder if even if I could
access it when I then tried to do something with it in the popup window
whether it would just fail?

My only ideas at the moment aside from accessing the view state are:

1. Use a session to hold the resource ID's currently added (dont want to do
this for the reason above)
2. As the button to add a resource is in my update panel and is created
dynamically, I could appended the resources ID's in an encrypted fashion to
the end of the link so that they are then available to the popup...for me
whilst this might work it felt a bit of a "dirty" solution, ie, if I have
all of the required data in one place, why replicate it again just to get
around this problem...

I could equally save the userRegistration objects data out on the load of
this page, and then pass a registration id across but the whole point of
using the viewState and my custom object in it was to avoid both session
time outs and hits back and forth to the database, compared to the original
version of this application it really is the dogs danglies so far (in my
opinion! :eek:) )

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top