
September 15th, 2003, 12:53 PM
|
|
Junior Member
|
|
Join Date: Sep 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Correct OOP Approach
Hi, I'm creating an application with a drop down menu that is populated by a database. The application has 4 other sections which also use the same drop down menu, however each of the 5 sections populate the drop down menu based on the section the user is in.
Currently I am using a single code behind file that queries the db and populates the drop down. I have all 4 sections using the same code behind file. Each section sends the code behind a parameter which allows the method to run the specific section query.
My questions are:
1. Is this the right way to do this?
2. Or should I create a class that all sections use? If I should create a class, what is the code behinds purpose, just to call the class?
I guess I'm kind of confused, it seems as though the code behind really is a class, I can place methods inside it and reuse them whereever I want. I would really like to be sure that I'm following OOP and doing this the correct way.
Thanks
|