User Control in Custom Control

Discussion in 'ASP .Net Web Controls' started by Eric Immerman, Jun 5, 2006.

  1. I have a tough one that I am hoping somebody has run across. I have created
    a Custom Control that is a fancy Tab Control where each Tab is assigned to a
    Panel. Each Panel needs to be able to hold whatever content the user would
    like.

    I have this setup and everything was working fine. Basically from the users
    perspective they would add the control to thier page like this:

    <cc1:DigiTab ID="tabAssigned" runat="server">
    <cc1:Tab Key="tabAssignedUsers" Text="Assigned Users">
    <ContentHTML>
    <SPAN>Assigned Users</SPAN>
    </ContentHTML>
    </cc1:Tab>
    <cc1:Tab Key="tabUnassignedUsers" Text="Unssigned Users">
    <ContentHTML>
    <SPAN>Unassigned Users</SPAN>
    </ContentHTML>
    </cc1:Tab>
    </cc1:DigiTab>

    On the backend I am simple taking anything between the ContentHTML tags and
    rendering them as a WebControls.Literal. This worked great until one of my
    users stuck a User Control that he had defined on his page, between my
    ContentHTML tag. Of course when he did this my control did not render his
    user control because I am dealing with it as a literal.

    Does anybody know a way that I can allow my users to pass User Controls into
    my control within a innerproperty?

    Regards,
    Eric Immerman
    Solution Manager Development
    Allin Interactive
    Eric Immerman, Jun 5, 2006
    #1
    1. Advertising

  2. Hi Eric,

    Take a look at this article for building templated custom controls
    http://msdn.microsoft.com/library/d...us/dnaspp/html/databoundtemplatedcontrols.asp

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Eric Immerman" wrote:

    > I have a tough one that I am hoping somebody has run across. I have created
    > a Custom Control that is a fancy Tab Control where each Tab is assigned to a
    > Panel. Each Panel needs to be able to hold whatever content the user would
    > like.
    >
    > I have this setup and everything was working fine. Basically from the users
    > perspective they would add the control to thier page like this:
    >
    > <cc1:DigiTab ID="tabAssigned" runat="server">
    > <cc1:Tab Key="tabAssignedUsers" Text="Assigned Users">
    > <ContentHTML>
    > <SPAN>Assigned Users</SPAN>
    > </ContentHTML>
    > </cc1:Tab>
    > <cc1:Tab Key="tabUnassignedUsers" Text="Unssigned Users">
    > <ContentHTML>
    > <SPAN>Unassigned Users</SPAN>
    > </ContentHTML>
    > </cc1:Tab>
    > </cc1:DigiTab>
    >
    > On the backend I am simple taking anything between the ContentHTML tags and
    > rendering them as a WebControls.Literal. This worked great until one of my
    > users stuck a User Control that he had defined on his page, between my
    > ContentHTML tag. Of course when he did this my control did not render his
    > user control because I am dealing with it as a literal.
    >
    > Does anybody know a way that I can allow my users to pass User Controls into
    > my control within a innerproperty?
    >
    > Regards,
    > Eric Immerman
    > Solution Manager Development
    > Allin Interactive
    Phillip Williams, Jun 6, 2006
    #2
    1. Advertising

  3. Thanks!! That article definitely solved my problem and my developers are
    once again happily making fancy Tab Controls...

    Thanks,
    Eric Immerman
    Solution Manager Development
    Allin Interactive

    "Phillip Williams" wrote:

    > Hi Eric,
    >
    > Take a look at this article for building templated custom controls
    > http://msdn.microsoft.com/library/d...us/dnaspp/html/databoundtemplatedcontrols.asp
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Eric Immerman" wrote:
    >
    > > I have a tough one that I am hoping somebody has run across. I have created
    > > a Custom Control that is a fancy Tab Control where each Tab is assigned to a
    > > Panel. Each Panel needs to be able to hold whatever content the user would
    > > like.
    > >
    > > I have this setup and everything was working fine. Basically from the users
    > > perspective they would add the control to thier page like this:
    > >
    > > <cc1:DigiTab ID="tabAssigned" runat="server">
    > > <cc1:Tab Key="tabAssignedUsers" Text="Assigned Users">
    > > <ContentHTML>
    > > <SPAN>Assigned Users</SPAN>
    > > </ContentHTML>
    > > </cc1:Tab>
    > > <cc1:Tab Key="tabUnassignedUsers" Text="Unssigned Users">
    > > <ContentHTML>
    > > <SPAN>Unassigned Users</SPAN>
    > > </ContentHTML>
    > > </cc1:Tab>
    > > </cc1:DigiTab>
    > >
    > > On the backend I am simple taking anything between the ContentHTML tags and
    > > rendering them as a WebControls.Literal. This worked great until one of my
    > > users stuck a User Control that he had defined on his page, between my
    > > ContentHTML tag. Of course when he did this my control did not render his
    > > user control because I am dealing with it as a literal.
    > >
    > > Does anybody know a way that I can allow my users to pass User Controls into
    > > my control within a innerproperty?
    > >
    > > Regards,
    > > Eric Immerman
    > > Solution Manager Development
    > > Allin Interactive
    Eric Immerman, Jun 6, 2006
    #3
  4. Thanks!! That article definitely solved my problem and my developers are
    once again happily making fancy Tab Controls...

    Thanks,
    Eric Immerman
    Solution Manager Development
    Allin Interactive

    "Phillip Williams" wrote:

    > Hi Eric,
    >
    > Take a look at this article for building templated custom controls
    > http://msdn.microsoft.com/library/d...us/dnaspp/html/databoundtemplatedcontrols.asp
    >
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "Eric Immerman" wrote:
    >
    > > I have a tough one that I am hoping somebody has run across. I have created
    > > a Custom Control that is a fancy Tab Control where each Tab is assigned to a
    > > Panel. Each Panel needs to be able to hold whatever content the user would
    > > like.
    > >
    > > I have this setup and everything was working fine. Basically from the users
    > > perspective they would add the control to thier page like this:
    > >
    > > <cc1:DigiTab ID="tabAssigned" runat="server">
    > > <cc1:Tab Key="tabAssignedUsers" Text="Assigned Users">
    > > <ContentHTML>
    > > <SPAN>Assigned Users</SPAN>
    > > </ContentHTML>
    > > </cc1:Tab>
    > > <cc1:Tab Key="tabUnassignedUsers" Text="Unssigned Users">
    > > <ContentHTML>
    > > <SPAN>Unassigned Users</SPAN>
    > > </ContentHTML>
    > > </cc1:Tab>
    > > </cc1:DigiTab>
    > >
    > > On the backend I am simple taking anything between the ContentHTML tags and
    > > rendering them as a WebControls.Literal. This worked great until one of my
    > > users stuck a User Control that he had defined on his page, between my
    > > ContentHTML tag. Of course when he did this my control did not render his
    > > user control because I am dealing with it as a literal.
    > >
    > > Does anybody know a way that I can allow my users to pass User Controls into
    > > my control within a innerproperty?
    > >
    > > Regards,
    > > Eric Immerman
    > > Solution Manager Development
    > > Allin Interactive
    Eric Immerman, Jun 6, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonah Olsson
    Replies:
    1
    Views:
    571
    Scott Allen
    Apr 5, 2005
  2. Leeor Chernov
    Replies:
    2
    Views:
    789
    Leeor Chernov
    Oct 16, 2005
  3. Mad Scientist Jr
    Replies:
    0
    Views:
    635
    Mad Scientist Jr
    Mar 22, 2006
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    541
    Jonathan Wood
    Feb 2, 2010
  5. Matt Sokol
    Replies:
    2
    Views:
    378
    Theo Tillotson
    Aug 7, 2003
Loading...

Share This Page