Class Sharing Across Controls And Pages

quantum5454

New Member
This is basicly the design question, Like what would be the best way to structure my code within my web asp.net 4.0 web forms application. My General Design is like this...\[code\]Master Page Has few User Controls Content Pages Inherit from Base Class User Controls within Content Pages\[/code\]I need to get some setting stuff from database in one CALL & store results into a Class. and then this class will be shared throughout the Pages (in Master Page, Base Class, Content Pages and user controls). What would be the best place to initialize this class and easily access it throughout the page lifectycle.Should I Hit Database & initialize the Class in BASE PAGE and then update Master Pages from within the BASE Class..like this\[code\]Page.master.findControl("label").Text = myClass.Setting1\[/code\]and then Content Pages and its user control would need access to this class as well.Please advise the best practice.
 
Back
Top