Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: passing values from one page to another per user


Message #1 by jmnamahoe@h... on Tue, 28 May 2002 19:44:21
i was wondering what the general norm for passing information from one 
page to another specific for one user. in my case i want to capture the 
user id and use it in a series of SQL statements. my questions is two 
parts:

1: what is the best practice for passing data from one page to another. i 
was reading the beginners book about 'sessions'. i was going to use this 
method, but i was wondering what other methods are there and what is the 
accepted norm.

2: i want to take the data that is passed from one page to another and use 
it in a series of SQL statements. once i'm able to retrieve the data from 
a different page, how do i work with the data. my first assumption is to 
place the data in a 'label' and then call the value from the label. i'm 
not sure on how to go about it, so again i'm wondering what is the best 
practice for using data that is pulled from a different page for SQL 
statements.

any advise would be appreciated. thanx.
Message #2 by Elissa Setarehshenas <elissasetareh@y...> on Tue, 28 May 2002 12:31:43 -0700 (PDT)
Hi,
The best way to do what you want is to use .net
cookies. 

Elissa Setareh 
--- jmnamahoe@h... wrote:
> i was wondering what the general norm for passing
> information from one 
> page to another specific for one user. in my case i
> want to capture the 
> user id and use it in a series of SQL statements. my
> questions is two 
> parts:
> 
> 1: what is the best practice for passing data from
> one page to another. i 
> was reading the beginners book about 'sessions'. i
> was going to use this 
> method, but i was wondering what other methods are
> there and what is the 
> accepted norm.
> 
> 2: i want to take the data that is passed from one
> page to another and use 
> it in a series of SQL statements. once i'm able to
> retrieve the data from 
> a different page, how do i work with the data. my
> first assumption is to 
> place the data in a 'label' and then call the value
> from the label. i'm 
> not sure on how to go about it, so again i'm
> wondering what is the best 
> practice for using data that is pulled from a
> different page for SQL 
> statements.
> 
> any advise would be appreciated. thanx.


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
Message #3 by "Maui Namahoe" <jmnamahoe@h...> on Tue, 28 May 2002 11:38:51 -1000
could you advise as to advantage/disadvantage of using cookies to store
specific information. thanx.
----- Original Message -----
From: "Elissa Setarehshenas" <elissasetareh@y...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Tuesday, May 28, 2002 9:31 AM
Subject: [aspx_beginners] Re: passing values from one page to another per
user


> Hi,
> The best way to do what you want is to use .net
> cookies.
>
> Elissa Setareh
> --- jmnamahoe@h... wrote:
> > i was wondering what the general norm for passing
> > information from one
> > page to another specific for one user. in my case i
> > want to capture the
> > user id and use it in a series of SQL statements. my
> > questions is two
> > parts:
> >
> > 1: what is the best practice for passing data from
> > one page to another. i
> > was reading the beginners book about 'sessions'. i
> > was going to use this
> > method, but i was wondering what other methods are
> > there and what is the
> > accepted norm.
> >
> > 2: i want to take the data that is passed from one
> > page to another and use
> > it in a series of SQL statements. once i'm able to
> > retrieve the data from
> > a different page, how do i work with the data. my
> > first assumption is to
> > place the data in a 'label' and then call the value
> > from the label. i'm
> > not sure on how to go about it, so again i'm
> > wondering what is the best
> > practice for using data that is pulled from a
> > different page for SQL
> > statements.
> >
> > any advise would be appreciated. thanx.
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
>
Message #4 by "Sri Vidya" <svsvidya@i...> on Wed, 29 May 2002 10:01:11 +0530
Hi,

You can use COOKIES. Write one comman function which reads data from 
the cookies and call this function as and when required.

If the amount of data is not huge, then you could make use of some 
global variables and populate these global variables once for all and 
use them in which ever page you want. 

HTH.

Cheers,
Vidya.

On Tue, 28 May 2002 19:44:21
  jmnamahoe@h... wrote:
>i was wondering what the general norm for passing information from 
>one 
>page to another specific for one user. in my case i want to capture 
>the 
>user id and use it in a series of SQL statements. my questions is two 
>parts:
>
>1: what is the best practice for passing data from one page to 
>another. i 
>was reading the beginners book about 'sessions'. i was going to use 
>this 
>method, but i was wondering what other methods are there and what is 
>the 
>accepted norm.
>
>2: i want to take the data that is passed from one page to another 
>and use 
>it in a series of SQL statements. once i'm able to retrieve the data 
>from 
>a different page, how do i work with the data. my first assumption is 
>to 
>place the data in a 'label' and then call the value from the label. 
>i'm 
>not sure on how to go about it, so again i'm wondering what is the 
>best 
>practice for using data that is pulled from a different page for SQL 
>statements.
>
>any advise would be appreciated. thanx.

---------------------------------------------
http://mail.indiainfo.com
India's first ISO certified portal
Check world time at http://time.indiainfo.com
Message #5 by "Sri Vidya" <svsvidya@i...> on Wed, 29 May 2002 10:15:28 +0530
The advantages of using cookies is that you can access information 
easily and whenever you want. They are globally accessible.

Disadvantages could be that your data will be stored on your local PC.

Cheers,
Vidiya.

On Tue, 28 May 2002 11:38:51 -1000
  "Maui Namahoe" <jmnamahoe@h...> wrote:
>could you advise as to advantage/disadvantage of using cookies to 
>store
>specific information. thanx.
>----- Original Message -----
>From: "Elissa Setarehshenas" <elissasetareh@y...>
>To: "aspx_beginners" <aspx_beginners@p...>
>Sent: Tuesday, May 28, 2002 9:31 AM
>Subject: [aspx_beginners] Re: passing values from one page to another 
>per
>user
>
>
>> Hi,
>> The best way to do what you want is to use .net
>> cookies.
>>
>> Elissa Setareh
>> --- jmnamahoe@h... wrote:
>> > i was wondering what the general norm for passing
>> > information from one
>> > page to another specific for one user. in my case i
>> > want to capture the
>> > user id and use it in a series of SQL statements. my
>> > questions is two
>> > parts:
>> >
>> > 1: what is the best practice for passing data from
>> > one page to another. i
>> > was reading the beginners book about 'sessions'. i
>> > was going to use this
>> > method, but i was wondering what other methods are
>> > there and what is the
>> > accepted norm.
>> >
>> > 2: i want to take the data that is passed from one
>> > page to another and use
>> > it in a series of SQL statements. once i'm able to
>> > retrieve the data from
>> > a different page, how do i work with the data. my
>> > first assumption is to
>> > place the data in a 'label' and then call the value
>> > from the label. i'm
>> > not sure on how to go about it, so again i'm
>> > wondering what is the best
>> > practice for using data that is pulled from a
>> > different page for SQL
>> > statements.
>> >
>> > any advise would be appreciated. thanx.
>>
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Yahoo! - Official partner of 2002 FIFA World Cup
>> http://fifaworldcup.yahoo.com
>>
>>
>

---------------------------------------------
http://mail.indiainfo.com
India's first ISO certified portal
Check world time at http://time.indiainfo.com
Message #6 by "Dan McKinnon" <mddonna@q...> on Wed, 29 May 2002 08:05:14
It doesn't seem like you've gotten a very complete answer so far, so I'll 
give you my two cents. 

>>>1: what is the best practice for passing data from one page to 
another. i 
was reading the beginners book about 'sessions'. i was going to use this 
method, but i was wondering what other methods are there and what is the 
accepted norm.<<<<

There are several ways to pass data from one page to another using IIS, 
some of which are specific to IIS and others which are not. Different 
forum users have already advised you to use cookies. This is not specific 
to IIS and has been around for a while. You can set cookies using either 
client side scripting (JavaScript) or server side languages. One 
disadvantage to cookies is that some users may not have cookies enabled 
in their browsers. Very few browsers in use today are not capable of 
using cookies, but due to surfer paranoia, in part fuelled by articles in 
magazines like PC Magazine (which I like, for the most part), some people 
just don't accept cookies. In addition to browsers being able to accept 
or not accept cookies, there are also fairly elaborate utilities 
available to protect and/or remove cookies. This is silly as far as I'm 
concerned, and obviously created by people who never had to try to 
maintain session state in their coding. 

Apparently, in ASP 3.0, session variables, another choice for persisting 
info from page to page, depended on cookies to work. With IIS using 
the .NET Framework, however, there is a so-called cookie-less mode, where 
the View_State (kind of a reference to the sessionID, as I understand it) 
is tacked onto to the URL like in a GET request, and IIS uses this to 
keep a session on a person who is not accepting cookies. So you could use 
either cookies or session variables, and maybe someone on the forum could 
tell you how to invoke cookie-less mode for the few people who don't 
accept cookies (I heard one estimate that this is something like 1 or 2 
per cent of users, but I'm not sure). 

There is another 'old' way to pass data between pages and that's to use 
hidden form fields. This is something that has been around at least as 
far back as html 3.2. It works but is not secure.

>>>>>2: i want to take the data that is passed from one page to another 
and use it in a series of SQL statements. once i'm able to retrieve the 
data from a different page, how do i work with the data. my first 
assumption is to place the data in a 'label' and then call the value from 
the label. i'm not sure on how to go about it, so again i'm wondering 
what is the best practice for using data that is pulled from a different 
page for SQL statements.<<<<<<

Once your data is in a cookie or session variable, pull it into the page 
as Minh detailed in an earlier post by me called 'cookies' (posted 
earlier this week). Then use the variable in a SQL statement and/or 
label. But you don't want to put it in the label first.

You can also set application level variables, but this is probably not 
what you want to do, judging from the context of your post. To do that, 
variables you set in an xml file are available to all user sessions. 

If anyone has anything to add, amend or correct about this post, have at 
it, I'm still learning.

HTH,
Dan
Message #7 by "Maui Namahoe" <jmnamahoe@h...> on Thu, 30 May 2002 15:39:40 -1000
what would be the advantage/disadvantage of using 'cookies' rather then a
'session'. i am able to pass a value between pages via a cookie, but i'm
wonderig what the direct advantage/disadvantage. any advise would be
appreciated. thanx
----- Original Message -----
From: "Sri Vidya" <svsvidya@i...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Tuesday, May 28, 2002 6:45 PM
Subject: [aspx_beginners] Re: passing values from one page to another per
user


> The advantages of using cookies is that you can access information
> easily and whenever you want. They are globally accessible.
>
> Disadvantages could be that your data will be stored on your local PC.
>
> Cheers,
> Vidiya.
>
> On Tue, 28 May 2002 11:38:51 -1000
>   "Maui Namahoe" <jmnamahoe@h...> wrote:
> >could you advise as to advantage/disadvantage of using cookies to
> >store
> >specific information. thanx.
> >----- Original Message -----
> >From: "Elissa Setarehshenas" <elissasetareh@y...>
> >To: "aspx_beginners" <aspx_beginners@p...>
> >Sent: Tuesday, May 28, 2002 9:31 AM
> >Subject: [aspx_beginners] Re: passing values from one page to another
> >per
> >user
> >
> >
> >> Hi,
> >> The best way to do what you want is to use .net
> >> cookies.
> >>
> >> Elissa Setareh
> >> --- jmnamahoe@h... wrote:
> >> > i was wondering what the general norm for passing
> >> > information from one
> >> > page to another specific for one user. in my case i
> >> > want to capture the
> >> > user id and use it in a series of SQL statements. my
> >> > questions is two
> >> > parts:
> >> >
> >> > 1: what is the best practice for passing data from
> >> > one page to another. i
> >> > was reading the beginners book about 'sessions'. i
> >> > was going to use this
> >> > method, but i was wondering what other methods are
> >> > there and what is the
> >> > accepted norm.
> >> >
> >> > 2: i want to take the data that is passed from one
> >> > page to another and use
> >> > it in a series of SQL statements. once i'm able to
> >> > retrieve the data from
> >> > a different page, how do i work with the data. my
> >> > first assumption is to
> >> > place the data in a 'label' and then call the value
> >> > from the label. i'm
> >> > not sure on how to go about it, so again i'm
> >> > wondering what is the best
> >> > practice for using data that is pulled from a
> >> > different page for SQL
> >> > statements.
> >> >
> >> > any advise would be appreciated. thanx.
> >>
> >>
> >> __________________________________________________
> >> Do You Yahoo!?
> >> Yahoo! - Official partner of 2002 FIFA World Cup
> >> http://fifaworldcup.yahoo.com
> >>
> >>
> >
>
> ---------------------------------------------
> http://mail.indiainfo.com
> India's first ISO certified portal
> Check world time at http://time.indiainfo.com
>
>

  Return to Index