473,803 Members | 3,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to maintain page state (like or as if by ViewState) when page is not posted-back?

5 New Member
The simple situation that works: A form (ASP 2.0 Page) with Page.MaintainSc rollPositionOnP ostBack set to True as well as Page.EnableView State defaults to True. As the form's data are submitted to server and page is rendered back, the form data as well as the page scroll positions are maintained. This is OK!

The complicated situation: After the form's data are submitted to server the page (let's call it X) is rendered back as usual, except that now upon 'onload' of the body (on the client side) - another page is called (let's call it Y) from a totally other different web-site. After the other page (Y) completes its processing it responds with redirecting to the first page (X). This causes the page X (the first page) to be called as if for the first time, and it is rendered back with none of the form's data that were posted to it previously, and with scroll positions set as in the real 1st time it was presented.

The requirements are that on the 2nd time that page X is called (when redirecting to it), it should be processed (including the form's data posted to it previously) and afterwards rendered much the same as it would be processed and rendered just in response to posting back the form's data without the intervening page Y. I.e. page X should be processed and rendered on the 2nd time much the same as in the simple situation that works (except for minor differences ONLY in the processing of the form's data because now processing is divided between the two calls for page X).

Please note: I've tried to use overriding SaveViewState and LoadViewState but this doesn't seem to work.

Thanks for any help!
Jun 10 '07 #1
1 1787
Itzik
5 New Member
At end, I have found solution for this my self. Basically it is based on using overrides for the following Page methods:
DeterminePostBa ckMode
SavePageStateTo PersistenceMedi um
LoadPageStateFr omPersistenceMe dium

For more details, you call me on e-mail.
Jun 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7781
by: Russell | last post by:
Morning, I have been having trouble with a my embedded user control not being able to see the view state that I set in its parent page. I have done a test with the following and I still cant get it to work! PARENT PAGE (default.aspx): private void Page_Load(object sender, System.EventArgs e)
3
2863
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a datagrid. I am using the viewstate object to store the Arraylist items on the page on postback. My PROBLEM is that I need to redirect the user to a new aspx page and on this new page i need to be able to access the items in my arraylist. Is this...
2
783
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past two days out of 100's of hits. The error just started yesterday and this app has been running for quite some time without this error and has not been updated just before or after the error started. Reseaching this error I've checked the...
2
1100
by: ken bus | last post by:
To truly persist the state of a web page for reentry as if one had never left the page, one must save the querystring values, request.form data, and of course the viewstate. I would like to know why Microsoft has not placed this support natively into Asp.Net but instead I must resort to a hack? See article at www.thecodeproject.com/useritems/PersistentStatePage.asp for details. When will such support be forthcoming?
5
2526
by: Peter | last post by:
Hello! I Have a problem. I try to use asp.net page-wide variable but it is not working. I declare my boolean variable (eg. bool done=false) in the same place where page's web controls are declared. However when I try to use it in a function, like if (this.done==false) { Response.Write("writing file") this.WriteFile();
1
1085
by: Keith Murray | last post by:
I have a custom web control, similar to a datagrid. The grid can have a button that the user clicks to select the row. I use a custom button with a data field that is stored in the Viewstate. So far, this is working fine. If I add another button to the row in exactly the same manner, the Viewstate for that button is not saved. I turned on the Trace for the page and it shows first button containing 56 bytes of Viewstate, but the second...
7
10360
by: Andrew Robinson | last post by:
I have a treeview control that I use as a menu & navigation control within a master page. The nodes for this control are loaded from a database which contains the text and url of each like and the hierarchy of the menu tree. All pretty normal stuff. Is there any simple method of maintaining the expanded / collapsed state of each node as my application moves from page to page? Remember this is on a master page used by numerous content...
5
1495
by: Frank | last post by:
I'm really stumped here. I have a couple pages where I'm using a datagrid and a custom paging solution. I store the current page, sort column, etc in the ViewState of the page. When a column is clicked or the pager control (custom) is clicked I load the view state to get any current values, then build the page accordingly... Problem: One of my pages works fine - paging is great and the ViewState loads as per normal. The other page...
3
8709
by: Nathan Sokalski | last post by:
I am recieving the following error on the second postback of a page I have written: The state information is invalid for this page and might be corrupted Stack Trace: System.Convert.FromBase64String(String s) +0
11
7924
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web applications. As far as I can see, the Session approach is non-standard since Web Services are supposed to be agnostic with respect to their clients. It seems that cookies are outside the Web Service standard; therefore, such a Web Service application...
0
9565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4275
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 we have to send another system
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.