c# - Share common designer code between two pages -


i'm creating 2 version of same page. want create common ancestor i'll need access controls code best way have set of common controls inside shared designer.cs file asp.net recreate each page (due axiomatization) reach asp tags same id on aspx file. there way anyway?

exmple (in code alike):

common.cs

partial class commonclass [...]     function x         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 , page2 allow user see table , change it's content (there several other controls). page1 fills table using set of objects. page2 fills table using set of different objects. yet way page1 , page2 fill data same (3 intermediate table constructed set of objects) , it's quite complex. since same (and quite complex) i'd liking filling logic in common file, since filling logic relies on repeaters, need repeater bedefined in common page well.

now i've run new test, apparently asp.net clever enough not redefine partial designer class controls defined in parent class.

sweet. it's working.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -