Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to create object of class at once..mns using oops concept if i create class n i want to use this class to all page. we alwayz create object in every page bt i want create once and use to all pages.
Posted
Updated 4-Oct-12 20:09pm
v2

1 solution

It looks like you want to create one instance of a "global" object. For this requirement, the singleton pattern should be used. I believe from an object oriented programming perspective, this is the right approach. See these links for more information:
Simple Singleton Pattern in C#[^]
http://msdn.microsoft.com/en-us/library/ff650316.aspx[^]
http://www.yoda.arachsys.com/csharp/singleton.html[^]
 
Share this answer
 

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