473,405 Members | 2,279 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,405 software developers and data experts.

View State - Query Strings

I have an aspx page, on this page I have a number of Labels.
If I response.Redirect("anotherPage.aspx") and then return by
Response.Redirect("InitialPage.aspx") without a query string,
the content of the Labels is maintained by View State.

If I return with a query string
Response.Redirect("InitialPage.aspx?Pram1=value1);
the contents of the Labels are not maintained.
Any suggestions as to how to maintain the contents of the Labels when using
a query string would be appreciated.
Sample code would be helpful.
Thanks in advance for your help,

Jim
Nov 19 '05 #1
1 1116
Jim,

The behavior that you're observing has more to do with caching of the page, rather than viewstate. When you do Response.Redirect("InitialPage.aspx") and go back to the initial page, you are looking at the copy of that page from your machine's cache. When you go back to InitialPage.aspx with a querystring parameter, there is no page corresponding to that URL in your cache, and so your values are not retrieved.

What you need is a mechanism that stores the values in the labels. If the values in the labels are part of a multi-page processing routine, then you should store them in the session object, perhaps as part of an object that gets passed from page to page. And then read the value from the session object when the page loads.

HTH
Altaf [MVP-VB]
--------------------------------------------------------------------------------

All that glitters has a high refractive index.
www.mendhak.com

"Jim McGivney" <mc****@no-spam.sbcglobal.net> wrote in message news:O9**************@TK2MSFTNGP12.phx.gbl...
I have an aspx page, on this page I have a number of Labels.
If I response.Redirect("anotherPage.aspx") and then return by
Response.Redirect("InitialPage.aspx") without a query string,
the content of the Labels is maintained by View State.

If I return with a query string
Response.Redirect("InitialPage.aspx?Pram1=value1);
the contents of the Labels are not maintained.
Any suggestions as to how to maintain the contents of the Labels when using
a query string would be appreciated.
Sample code would be helpful.
Thanks in advance for your help,

Jim
Nov 19 '05 #2

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

Similar topics

2
by: abefuzzleduser2 | last post by:
I am using sql 2000 (mdb) with linked tables on SQL 2000. I need to use views to limit users records, instead of direct table access. I setup a single talbe view in sql and tested update and...
10
by: Zack Sessions | last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command and ADO.NET? If so, is there a trick in trapping a SQL error when trying to create the view? I have a VB.NET app that, amoung...
20
by: raptor | last post by:
hi, I want to make the following thing : select-based updatable VIEW, which have two more virtual-fields. One of them is concatenation of others and the second is calculated on the fly. Can I...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
3
by: mike | last post by:
On DB2 EEE v8.2 on Linux/Windows/Unix, is there any catalog view that I can query with SQL to find tablespace-state? The state is not visible via SYSCAT.TABLESPACES. The state is visible by...
8
by: s_wadhwa | last post by:
SELECT DISTINCTROW "01C" AS dummy, Buildings.BuildingNumber, UCASE(Buildings.BuildingName) AS BuildingName, Buildings.MasterPlanCode, Buildings.UniformBuildingCode,...
1
by: rcamarda | last post by:
I was looking through our vendors views, searching for something I needed for our Datawarehouse and I came across something I do not understand: I found a view that lists data when I use it in...
12
by: brwalias | last post by:
Hi, using .net 2 sql server 2005 Here is my situation: I'm passing a variable in the url from a selection on Page A and need to display the results on the Results page be based on that...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...

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.