Wednesday, March 28, 2012

the best way to have some information accessable to all pages?

hello all,
I need to have access to some details in all my pages eg a Person object.
what is the best way to do it?
store in session object? or pass them through the QueryString or Application
variables etc?
what is the best and efficient way?It really depends on the nature of the application. Overall, I am not fond o
f
putting everything in hidden tags so it can travel on the Query String. It
potentially opens security holes.
Where you store information depends on the nature of the information.
If it is linked to the user, cookies are an option. For security, you can
send the user's token instead, or link it to the session ID. This will
require grabbing the information with each return, but it is safer than
storing in the cookie.
For session specific information, you can use the Session object as a cache.
You can also use the cache manager functionality of ASP.NET.
For page specific information (like the Person object is the person being
worked on, not the person using the app), you can use ViewState.
As I stated at the beginning, it really depends on the nature of the
application.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Annie" wrote:

> hello all,
> I need to have access to some details in all my pages eg a Person object.
> what is the best way to do it?
> store in session object? or pass them through the QueryString or Applicati
on
> variables etc?
> what is the best and efficient way?
>
>

0 comments:

Post a Comment