Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business Objects in Master Pages
Message
 
À
12/06/2006 22:37:52
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01128565
Message ID:
01128806
Vues:
20
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform