Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Instead of using sessions can I use a server side object in .Net instead of sessions etc.

Is there a .Net equvialent java bean object that I can use server side to hold form data in an object.
0
Sparky191
Asked:
Sparky191
3 Solutions
 
margantCommented:
Sparky191,
You can use
* Application("whatever")=value - which would hold for all the users of that system (global variable for all users)
* Cache object which is a recent introduction to ASP (in .NET( which is same as sessions but server-side), works for all users of the system). Example for Cache : http://aspnet.4guysfromrolla.com/articles/022802-1.aspx
-A.M.
0
 
Sparky191Author Commented:
Appreciate the info, thanks...
0
 
b1xml2Commented:
There are various object to hold information about form data.
1. ViewState is a client-server object. It resides on the client but is recreated on the server across every postback. Lifetime is constrained to be that of the page (as long as the browser has not closed the page and cleared the cache!). Scope is only that page.
2. Session is across all pages for that user using that Session. Thus, a user can have two separate browser windows, and have consequently two separate sessions (if the re-use process in MSIE is switched off when using control+n...). The lifetime of the session is determined by the System. By default, it is 20 mins
3. Cache is across all pages for ALL users and is visible to all. Lifetime of cache objects is determined largely by the settings used in creating the cache item as well as the available resources on the server. In short, the period can often be indeterminate in the sense that if you set the expiry datetime to be every day, the data could technically be flushed out more often than was set because of resource limitations. So one has to code to repopulate the cache item if it is empty when called. As opposed to all other items, the Cache object allows you to set dependencies on files. In ASP.NET 2.0, you can even set dependencies on the MSSQL Server.
4. Application objects do not get flushed unless the application is unloaded.


The best object depends on your needs and the server configuration: whether there is a web farm (multiple servers) and/or a web garden (multiple processors). Where the worker process runs in-process (fast) or out of process (scalable).
0
 
RejojohnyCommented:
u could create ur own class and use serialization to store the isntance of the class (object) onto ur disk too ...
0
 
Sparky191Author Commented:
Thanks for the info. I can work with what you've given. Me Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now