Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Passing data between pages?

Reply
Thread Tools

Passing data between pages?

 
 
Smokey Grindle
Guest
Posts: n/a
 
      06-23-2006
For a website that has users logged into it using sessions, its it best to
pass data between pages in session variables or through query strings?


 
Reply With Quote
 
 
 
 
Ethan V
Guest
Posts: n/a
 
      06-23-2006
My preference is to use Server.Transfer and HTTPContext.Items to pass data
between pages, and I am willing to live with out-of-sync URL. I minimize the
use of session to absolute mininal for resource conservation reason. I do
not use query string ask I don't like people hacking with the query strings.
If I were to use query string I would encrypt it.

"Smokey Grindle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>



 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      06-23-2006
It depends on what data you are passing, how much data you are passing and
how that data will be used.

If the data needs to be secured or there will be more than 1K of data, then
QueryStrings are out. On the other hand, sessions (if not used right) can
be costly to the server and in web farm environments won't work.

The most secure and robust way is to store the data in a database.

"Smokey Grindle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>



 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      06-23-2006
Here's another 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("handle_error.aspx ")

Then, in handle_error.aspx.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
besides the querystring there are 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 more good articles on the subject:
http://SteveOrr.net/faq/PassValues.aspx
http://www.aspalliance.com/kenc/passval.aspx
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Smokey Grindle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> For a website that has users logged into it using sessions, its it best to
> pass data between pages in session variables or through query strings?
>
>



 
Reply With Quote
 
Smokey Grindle
Guest
Posts: n/a
 
      06-23-2006
well for example I need to pass this set of information from page to page
which may different pages may change the information..

Folder (path on a hierachy of data currently on, string under 200 chars)
MessageID (ID of node in the folder, Int64)
ActionGUID (Unique ID of last action performed)

besides that, not much else will be there...

"Scott M." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> It depends on what data you are passing, how much data you are passing and
> how that data will be used.
>
> If the data needs to be secured or there will be more than 1K of data,
> then QueryStrings are out. On the other hand, sessions (if not used
> right) can be costly to the server and in web farm environments won't
> work.
>
> The most secure and robust way is to store the data in a database.
>
> "Smokey Grindle" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> For a website that has users logged into it using sessions, its it best
>> to pass data between pages in session variables or through query strings?
>>
>>

>
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      06-23-2006
And what if someone hacks your querystring by forcing different data into
it?


"Smokey Grindle" <(E-Mail Removed)> wrote in message
news:u%(E-Mail Removed)...
> well for example I need to pass this set of information from page to page
> which may different pages may change the information..
>
> Folder (path on a hierachy of data currently on, string under 200 chars)
> MessageID (ID of node in the folder, Int64)
> ActionGUID (Unique ID of last action performed)
>
> besides that, not much else will be there...
>
> "Scott M." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> It depends on what data you are passing, how much data you are passing
>> and how that data will be used.
>>
>> If the data needs to be secured or there will be more than 1K of data,
>> then QueryStrings are out. On the other hand, sessions (if not used
>> right) can be costly to the server and in web farm environments won't
>> work.
>>
>> The most secure and robust way is to store the data in a database.
>>
>> "Smokey Grindle" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> For a website that has users logged into it using sessions, its it best
>>> to pass data between pages in session variables or through query
>>> strings?
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Smokey Grindle
Guest
Posts: n/a
 
      06-23-2006
That's the point of asking whats the best method of doing this, I'm trying
to get rid of query strings, I just dont know how best to handle it

"Scott M." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> And what if someone hacks your querystring by forcing different data into
> it?
>
>
> "Smokey Grindle" <(E-Mail Removed)> wrote in message
> news:u%(E-Mail Removed)...
>> well for example I need to pass this set of information from page to page
>> which may different pages may change the information..
>>
>> Folder (path on a hierachy of data currently on, string under 200 chars)
>> MessageID (ID of node in the folder, Int64)
>> ActionGUID (Unique ID of last action performed)
>>
>> besides that, not much else will be there...
>>
>> "Scott M." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> It depends on what data you are passing, how much data you are passing
>>> and how that data will be used.
>>>
>>> If the data needs to be secured or there will be more than 1K of data,
>>> then QueryStrings are out. On the other hand, sessions (if not used
>>> right) can be costly to the server and in web farm environments won't
>>> work.
>>>
>>> The most secure and robust way is to store the data in a database.
>>>
>>> "Smokey Grindle" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> For a website that has users logged into it using sessions, its it best
>>>> to pass data between pages in session variables or through query
>>>> strings?
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      06-23-2006
Well, if you see my first response, I mentioned that if security is an
issue, QueryStrings are out.


"Scott M." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> And what if someone hacks your querystring by forcing different data into
> it?
>
>
> "Smokey Grindle" <(E-Mail Removed)> wrote in message
> news:u%(E-Mail Removed)...
>> well for example I need to pass this set of information from page to page
>> which may different pages may change the information..
>>
>> Folder (path on a hierachy of data currently on, string under 200 chars)
>> MessageID (ID of node in the folder, Int64)
>> ActionGUID (Unique ID of last action performed)
>>
>> besides that, not much else will be there...
>>
>> "Scott M." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> It depends on what data you are passing, how much data you are passing
>>> and how that data will be used.
>>>
>>> If the data needs to be secured or there will be more than 1K of data,
>>> then QueryStrings are out. On the other hand, sessions (if not used
>>> right) can be costly to the server and in web farm environments won't
>>> work.
>>>
>>> The most secure and robust way is to store the data in a database.
>>>
>>> "Smokey Grindle" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> For a website that has users logged into it using sessions, its it best
>>>> to pass data between pages in session variables or through query
>>>> strings?
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data between tiers on diff. servers TS ASP .Net 2 05-20-2004 04:02 PM
Passing data between 2 form ! =?Utf-8?B?Sm9obg==?= ASP .Net 4 04-02-2004 10:37 PM
Passing data between .aspx and .vb files vengala s reddy ASP .Net 2 03-04-2004 07:00 PM
passing data between forms in the "cleanest" OO way? =?Utf-8?B?bXN5ZXo=?= ASP .Net 1 02-05-2004 10:26 AM
Passing large data between forms, different apps terry ASP .Net 1 07-07-2003 06:05 PM



Advertisments