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

Best way to get data into called page: session or new database call??

P: n/a
My 1st page calls a 2nd that uses same data from a database. What is
the best way to get the data in the second: a new call to the database
or passing array through session variable??

I seems to me that avoiding a new call will speed up things but my
concerne is that I have read many posts with caution messages againts
session vars.

Has anybody tested session var stability in this common scenario?

Thanks
Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Perdit wrote:
My 1st page calls a 2nd that uses same data from a database. What is
the best way to get the data in the second: a new call to the database
or passing array through session variable??

I seems to me that avoiding a new call will speed up things but my
concerne is that I have read many posts with caution messages againts
session vars.

Has anybody tested session var stability in this common scenario?

Thanks


How is the second page getting "called"? It is certainly possible in many
cases to pass data from one page to another without using session variables.
For example, you can use a querystring to pass the data to the second page.
Or, if submitting a form, just read the data from the Form variables
collection

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2

P: n/a
Taking the information from session vairable is definitely faster but yes it
may also happen that the session values may have been lost.
You can make it conditional on the second page where you can check if the
values of session varibles are still in store from the previous page or not.
If not then make a call to database.
Also is the second page that you are calling, in the same domain.
I mean if the first page is in http and if the second page you are calling
is https (secured) then mind well that the session variables from the first
page won't work as the domain gets changed and so the session values will be
lost. In that case you can pass information from first page through
querystring or from the form variables.

Niel

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:O7**************@TK2MSFTNGP09.phx.gbl...
Perdit wrote:
My 1st page calls a 2nd that uses same data from a database. What is
the best way to get the data in the second: a new call to the database
or passing array through session variable??

I seems to me that avoiding a new call will speed up things but my
concerne is that I have read many posts with caution messages againts
session vars.

Has anybody tested session var stability in this common scenario?

Thanks
How is the second page getting "called"? It is certainly possible in many
cases to pass data from one page to another without using session

variables. For example, you can use a querystring to pass the data to the second page. Or, if submitting a form, just read the data from the Form variables
collection

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #3

P: n/a
Yes, I forgot to say that session or database asp were the options I
wanted to ask about. I could not pass FORM variables and wanted to
avoid URL querystring.

The session variables are available since I just open a new window
with the called page. I was now wondering under what circumstances
the session vars would not be available aside from the intrinsic
session limitations.

Thanks
Jul 19 '05 #4

P: n/a
> Taking the information from session vairable is definitely faster

Faster than what? And no matter what your answer is, this is not a given...
it really depends.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #5

P: n/a
> The session variables are available since I just open a new window
with the called page.
And you can't post a form to a new window???
I was now wondering under what circumstances
the session vars would not be available aside from the intrinsic
session limitations.


http://www.aspfaq.com/2157

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #6

P: n/a
aspfaq.com seems to be a nice site. Very useful information.

-rwg

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.