I'm creating two version of the same page. So I want to create a common ancestor but I'll need to access some Controls from that code so the best way to do that would be to have the set of common Controls inside a shared designer.cs file but ASP.Net will recreate those for each page (due to axiomatization) as soon as it reach the asp tags with the same ID on the aspx file. Is there a way to do this anyway?
Exmple (in code look alike):
common.cs
partial class CommonClass [...]
Function X
Do something with MyRepeater
common.designer.cs (or other file name)
partial class CommonClass
protected global::System.Web.UI.WebControls.Repeater MyRepeater;
page1.cs
Page1 : CommonClass
page1.aspx
[...]
<asp:Repeater ID="MyRepeater" runat="server" [...]
page2.cs
Page2 : CommonClass
page2.aspx
[...]
<asp:Repeater ID="MyRepeater" runat="server" [...]
EDIT: page1 and page2 allow the user to see a table and change it's content (there also are several other controls). page1 fills the table using a set of objects. page2 fills the table using a set of completely different objects. Yet the way page1 and page2 fill the data is the same (3 intermediate table are constructed from the set of objects) and it's quite complex. Since it the same (and quite complex) I'd liking the filling logic to be in a common file, but since that filling logic relies on some repeaters, I need those repeater to bedefined in the common page as well.