codebehind best practices
Posted on 2004-09-20
I've got a set of 3 aspx pages that all follow a certain template. They all contain a repeater, dropdownlist and 4 navigation buttons. I'm using the same codebhind for all 3 pages to handle click events and bind the data in the Page_Load. However, on some pages, I need aditional coding in the Page_Load. If I explicitly include a Page_Load in a <script runat="server"></script> block on this page, it overrides the Page_Load that is contained in the codebhind, so I'm forced to duplicate the Page_Load code in the codebehind and add the extra code required for this specific page... What can I do to prevent duplicating the data? Also, is it possible to have multiple files for the codebehind? Keep in mind I want to follow best practices...