473,503 Members | 11,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transfering viewstate from one page to another?

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
Feb 23 '07 #1
2 1795
you should use session instead of viewstate and your users will enjoy
quicker pages.

-- bruce (sqlwork.com)

Rob Meade wrote:
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

Feb 23 '07 #2
"bruce barker" wrote ...
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... :o)

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

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! :o) )

Rob
Feb 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2627
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
7
3028
by: JezB | last post by:
How can I get to a page's ViewState from inside a business object ? I have a reference to the calling page but the ViewState property of the Control class is protected. Is there something...
3
2306
by: jzink | last post by:
How come I can use the following line in my page_load ViewState = "xxxx" But when I try the same line of code in another function I get the following compile error An object reference is...
4
2126
by: nicholas | last post by:
I'm using context to transfer variables from 1 page to another. But, with more than 2 pages it fails. Ex: page1.aspx: Context.Items.Add("customername", customername.text)...
3
4547
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
11
2462
by: Nad | last post by:
Hello, I have a page with two link buttons. When I click on the first one I call server.execute("target.aspx") to view target.aspx on the original page. Then I click on the second link button...
10
3060
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
10
1611
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s);...
3
626
by: George Thompson | last post by:
Hi, I come from an ASP background, and I am currently working on a .NET project, so please excuse me if this is a dumb question ... I have written a dynamically generated menu that uses the...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.