473,395 Members | 1,653 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,395 software developers and data experts.

Keeping state without the session object or the query string

Hi all,

I need to maintain state between two pages but for two pissy reasons I can't
use the Session object and the Query String isn't ideal because its too easy
to tamper with.

I'm wondering what my options are?

As I understand it, I can either encrypt the QS on the way out to the client
somehow

or

I could use form variables to post information but I don't know how to do
that. Any advice, very much appreciated

Thanks all

Simon
Nov 18 '05 #1
1 1309
Simon, you could simply add the values directly to the viewstate.

if not page.ispostback then
ViewState.Add("someKey", "someValue")
ViewState.Add("someOtherKey", "someOtherValue")
else
dim someValue as string = cstr(ViewState("someKey"))
dim someOtherValue as string = cstR(ViewState("SomeOtherKey"))
end if

ViewState actually saves values into a hidden form field, so it's pretty
much the same as your 2nd idea.

Alternatively, you could use Page.RegisterHiddenFormField("someKey",
"someValue") and then read the values back via Request.Form("someKey")
Again, those two do pretty much the same thing. These are also very easy to
tamper with though, so I'm not sure how much better off that idea is than
the QS.

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Simon" <sh856531@microsofts_free_email_service.com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
Hi all,

I need to maintain state between two pages but for two pissy reasons I can't use the Session object and the Query String isn't ideal because its too easy to tamper with.

I'm wondering what my options are?

As I understand it, I can either encrypt the QS on the way out to the client somehow

or

I could use form variables to post information but I don't know how to do
that. Any advice, very much appreciated

Thanks all

Simon

Nov 18 '05 #2

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

Similar topics

9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
3
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net...
5
by: Mike | last post by:
I have the need to keep a substantial amount of session state, but I do not have the option of using the HttpSessionState object. My current scheme for dealing with this is to convert all the...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.