473,394 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Ideal way of posting a value to a new page?

Is there any ideal way of passing values to another page using Post method
and avoiding Sessions and Viewstate?

I have used Viewstate unsuccessfully. Though I've set all the required
attributes to the form including enableviewstatemac property to false. But
it did not work.

The I used the following code:
In the source page add the code:

Me.Context.Items.Add("Value", txtValue.Text)

In the destination page add the code :

Me.Context.Items.Item("Value").ToString

This was working on my machine but when I moved it to the client's server, I
was getting error "Viewstate corrupted". I felt the problem was with the
client's .NET Framework version. They use 1.0 whereas I use 1.1. So, atlast
I pulled in the Session. This was working fine. After I use the data fetched
by the session, I am putting the value in the ViewState of the destination
form and killing the session (Session("ID") = Nothing). Now, If I click on
the browser's refresh button, my application does not work because I don't
have the value in the session. And the Viewstate also does not contain the
stored value wither.

I can't retain the value in the session because else where in the
application I am opening the same page but then don't pass any values.

I was thinking there should be an ideal way to post values to a new page
other than using Viewstate and Session.

--
Thank you.

Satish Appasani
#201, Wing - 1, Block - D
Cyber Gateway
Hyderabad - 500 081, India
Phone: +91(40)2311-1356 Ext-122
Mobile: +91(40)333-31032
E-mail: sa****@vertexcs.com
Nov 17 '05 #1
1 1734
Hi,

If I understood you correctly you trying to pass a Form data from page
to page (using server.transfer ?) and getting invalid viewstate. If this
is the case the reason is related to the fact that the target page tries
to get the last state of controls from the forms __viewsatate field but
the control tree of the target page don’t match the control tree stored
in __viewstate. You can workaround it by sending the Form as an object
in the Context object and get its values in the target page.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

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

Similar topics

2
by: TJ Talluto | last post by:
Hi, I'm using the curl functions in php to scrape the wan ip address from my home router (the router is an SMC product). This is a two step process: 1. post the password value to the login.htm...
1
by: Chris Lasher | last post by:
Hello, I'm trying to write a tool to scrape through some of the Ribosomal Database Project II's (http://rdp.cme.msu.edu/) pages, specifically, through the Hierarchy Browser....
2
by: Rob Shorney | last post by:
Hi, We currently have a classic asp web application. We are currently looking at upgrading this to ASP.NET. However I have a couple of problems that need to be resolved. 1. aspx forms...
5
by: Bryan | last post by:
I am trying to get to a label control to get its Text value. from a previous page. The label control is buried in a Web User Control that is in a webpart zone. When I use this code:...
6
by: KC | last post by:
How would I post data from a listbox that allows multiple selections? How do you join the name/value pairs for the posted data? And for extra credit: Where is a page posting to when there is no...
0
by: msnews.microsoft.com | last post by:
I have been raking my brains on why this does not work. I get back the same login screen again instead of the home page redirection which should occur after a successful login: 'create a cookie...
2
by: Peter2 | last post by:
Hi, I have a problem posting non-ASCII characters in FORM fields between classic ASP and ASP.NET. I use a fully patched Windows 2000 Advanced Server with .net 2.0 and visual Studio 2005 installed,...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...
0
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...
0
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...

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.