Author: boosterch | Posted on: 7/15/2009 1:22:06 AM | Views : 1071

Is there someway to build a control and bind multiple codebehind files againts it.
So we can seperate the code among multiple controls and not using inheritance!
It works when I do it static, but i would like it to be dynamic, but then the binding of the attributes does not work
Below is a simple example that works like this:
1. first i create a interface control that holds all the attributes of the ascx
2. then i create two extra codebehind controls that seperates the attributes of the interface
3. oninit we bind the interface attributes to the codebehind attributes
4. then we attach the codebehind controls to the control tree of the interface.

Code (put this in a single apsx page and see how it works)
<%@ Page Language="C#" AutoEventWireup="true" %> Code 1: <asp:Literal ID="ltlCode1" runat="server" /><br /> Code 2: <asp:Literal ...

Go to the complete details ...