Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when to use Application object in c#
Posted
Comments
Vi(ky 8-May-14 7:20am    
//one way
String[] users = new String[1000];
Application["users"] = users;

// Another way
Application.Add("users", users);

// Another way
string[] usersTable = (string[])Application["users"];
Sanket Saxena 8-May-14 7:22am    
Vicky...does this explain what and when to use application object in c#? If you want to answer then add a solution not comment. :)
DipsMak 8-May-14 8:16am    
right sanket still vicky's post is helpful for quick ref.
Sanket Saxena 8-May-14 8:17am    
Thanks and glad to help you :)

well application object is generally used when you maintain a value of particular object throughout the application regardless user session or anything. suppose you have some master settings which are coming from database like page size or anything you can save it in application object and that you can use that on any page in the application. no matters who is login in the application, if you want some values based on the user profile you should use session variable.
 
Share this answer
 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900