S
steve cobian
Hi:
Is it posible to have differet GUI .ascx file to "use" the
same code behind? I have many ascx which have the same
number of conrols in it and the same business logic to
handle the control events. The only difference among
these ascx is their html layout being visually different.
Currently when I create a new ascx, I would create a new
layout of the same controls, then copy the existing code-
behind in the ascx.cs file, and just change the class name
to the control name. This is not elegant, inefficient,
and unmanageable: one change in one code-behind, need to
populate to all files. Using some sorts of template, or
inheritance may be the right way to do this kind of work.
Could anybody share some experience of how to make this
possible, or is this impossible, or too hard to do? Thanks
in advance.
Is it posible to have differet GUI .ascx file to "use" the
same code behind? I have many ascx which have the same
number of conrols in it and the same business logic to
handle the control events. The only difference among
these ascx is their html layout being visually different.
Currently when I create a new ascx, I would create a new
layout of the same controls, then copy the existing code-
behind in the ascx.cs file, and just change the class name
to the control name. This is not elegant, inefficient,
and unmanageable: one change in one code-behind, need to
populate to all files. Using some sorts of template, or
inheritance may be the right way to do this kind of work.
Could anybody share some experience of how to make this
possible, or is this impossible, or too hard to do? Thanks
in advance.