kmansari
December 24th, 2002, 01:06 PM
I am working on a web solution, the structure of which looks like:
+------> Page1.aspx
|
MainPage.aspx ---+-------> Page2.aspx
 |
+-------> Page3.aspx
The user can choose which page to go to using a radiobutton list on the Main page.
The presentation of all the three pages (Page1.aspx, Page2.aspx, and Page3.aspx) is divided into two parts: the upper part is common to all three pages, and it contains UI elements (a header, a few drop downs and a couple of text-boxes) that are all populated from the same database source. The event handling code (written in C#) for those controls is same too. The lower part is "page specific".
Currently, I am working with only three pages, but the number of pages will grow soon, and all of those pages will follow the same two part structure, with the top part being common to all.
My problem is: even though I have common UI elements on all the pages, and the event handler code for all the UI elements is the same, I am unable to maintain a common .ASPX and .ASPX.CS file for all the pages. So my code is getting replicated in each and every page.
I tried using a common base class that has all the definitions for the UI elements and the code that handles those controls. So this way, the declaration of those controls (and related code) wont be in Page*.aspx.cs, but rather, it will be in a file called, Common.aspx.cs.
However, when I compile my solution, VisualStudio.NET inserts all the "missing" declarations into all the Page*.aspx.cs files, thereby hiding the base class declarations for the UI elements.
I would appreciate your thoughts and/or ideas and/or solutions on this problem.
Thanks a lot,
-kmansari
+------> Page1.aspx
|
MainPage.aspx ---+-------> Page2.aspx
 |
+-------> Page3.aspx
The user can choose which page to go to using a radiobutton list on the Main page.
The presentation of all the three pages (Page1.aspx, Page2.aspx, and Page3.aspx) is divided into two parts: the upper part is common to all three pages, and it contains UI elements (a header, a few drop downs and a couple of text-boxes) that are all populated from the same database source. The event handling code (written in C#) for those controls is same too. The lower part is "page specific".
Currently, I am working with only three pages, but the number of pages will grow soon, and all of those pages will follow the same two part structure, with the top part being common to all.
My problem is: even though I have common UI elements on all the pages, and the event handler code for all the UI elements is the same, I am unable to maintain a common .ASPX and .ASPX.CS file for all the pages. So my code is getting replicated in each and every page.
I tried using a common base class that has all the definitions for the UI elements and the code that handles those controls. So this way, the declaration of those controls (and related code) wont be in Page*.aspx.cs, but rather, it will be in a file called, Common.aspx.cs.
However, when I compile my solution, VisualStudio.NET inserts all the "missing" declarations into all the Page*.aspx.cs files, thereby hiding the base class declarations for the UI elements.
I would appreciate your thoughts and/or ideas and/or solutions on this problem.
Thanks a lot,
-kmansari