By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,717 Members | 2,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,717 IT Pros & Developers. It's quick & easy.

Passing User Values from screen to screen

P: n/a
Hi there,
I'm currently creating a .NET Web Application and I have a question about
passing values from one screen to another. I previously used Session
variables in the code to store these values, however I can no longer use
this method because of my current website "Cloaking" the URL. (When site is
cloked, the session variables don't seem to work with frames)

Anyway, I was wondering if anyone could offer an alternative, I have tried
using the querystring however this isn't secure as users can type different
values in the URL path and possibly have access to resources they are not
supposed to.

My question is are there alternatives to pass values that the user has
selected from one point to another, I guess I can drive it by the database
so long as I can always store their UserID once logged in somewhere but that
brings me back to the original question, how does the UserID store itself
throughout the duration of the users session without using the server
session variable.

Any help appreciated.

Regards, Russell
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetjunkies.com/tutoria...tutorialid=600

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Russell" <sp**@footytipper.net> wrote in message
news:AO******************@news-server.bigpond.net.au...
Hi there,
I'm currently creating a .NET Web Application and I have a question about
passing values from one screen to another. I previously used Session
variables in the code to store these values, however I can no longer use
this method because of my current website "Cloaking" the URL. (When site is cloked, the session variables don't seem to work with frames)

Anyway, I was wondering if anyone could offer an alternative, I have tried
using the querystring however this isn't secure as users can type different values in the URL path and possibly have access to resources they are not
supposed to.

My question is are there alternatives to pass values that the user has
selected from one point to another, I guess I can drive it by the database
so long as I can always store their UserID once logged in somewhere but that brings me back to the original question, how does the UserID store itself
throughout the duration of the users session without using the server
session variable.

Any help appreciated.

Regards, Russell

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.