473,770 Members | 6,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1340
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.RegisterHi ddenFormField(" someKey",
"someValue" ) and then read the values back via Request.Form("s omeKey")
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@micro softs_free_emai l_service.com> wrote in message
news:eo******** ******@tk2msftn gp13.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
2385
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 - perhaps I'm just not very smart or perhaps MS is making this too hard for us sql bunnies to understand - I dunno, but I'd really appreciate someone explaining what I'm doing wrong here & perhaps suggest a better approach.. I'm familiar with use of...
3
3444
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 session object (using state service). I'd like to start breaking out our functionality into component projects, but I'd like to get this session issue worked out first. Any ideas?? I found this article , but it sounds like kind of a pain.
5
3289
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 state values to strings, place them in the query string of the URL passed to Server.transfer(), and then pull them out again in the next page. This has a number of problems including the following: - I have to manually marshall the state to and...
1
2412
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 the differences, e.g that every object you store in SQLSession state have to be serializable, but other differences are very unfortunate.
0
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
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
10232
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...
1
10008
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,...
0
9873
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6682
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();...
0
5313
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3578
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.