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

A

Annie

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?
 
G

Guest

It really depends on the nature of the application. Overall, I am not fond of
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!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top