Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Objects in Master Pages
Message
 
To
12/06/2006 22:37:52
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01128565
Message ID:
01128806
Views:
19
Rex,

>I have a business object I instantiate in the master page, but I also use it in a content page. What I am doing now is to conditionally create the business object if it does not exist using the GetBizObj method. Is there a better way to do this?

You could create a static property that holds a reference to this business object and use lazy loading to instantiate it. For example:
public static MyBizObj BizObj
{
   get 
   {
      if (_bizObj == null)
      {
         _bizObj = new MyBizObj();
      }
      return _bizObj;
   }
}
private static MyBizObj _bizObj;
You can then reference the business object from anywhere in your application.
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform