Literal content is not allowed within a CustomControl?

Discussion in 'ASP .Net Building Controls' started by Dave, Aug 2, 2006.

  1. Dave

    Dave Guest

    Is there a way to put content between tags of a custom control so that it
    will populate the defaultproperty such as my TabLabel property? When I tried
    to put values between the tags I got the error.

    I have ParseChildren as ParseChildren(true, "Tabs")] where Tabs are part of
    a tab strip I declare below. The DropDownList control allows this with it's
    Value property and I'm wondering how it works...

    <cc1:tabstrip id="TabStrip1" runat="server">
    <cc1:Tab TabLabel="One">One</cc1:Tab>
    <cc1:Tab TabLabel="Two">Two</cc1:Tab>
    </cc1:tabstrip>
     
    Dave, Aug 2, 2006
    #1
    1. Advertising

  2. Dave

    Dave Guest

    Actually what I meant to say was the ListItem of the DropDownList control
    allows it's Text property to be mapped to what ever inner content is defined.

    <asp:DropDownList ID="ddwn1" runat=server>
    <asp:ListItem Value="1">One</asp:ListItem>
    <asp:ListItem Value="2">Two</asp:ListItem>
    </asp:DropDownList>

    "Dave" wrote:

    > Is there a way to put content between tags of a custom control so that it
    > will populate the defaultproperty such as my TabLabel property? When I tried
    > to put values between the tags I got the error.
    >
    > I have ParseChildren as ParseChildren(true, "Tabs")] where Tabs are part of
    > a tab strip I declare below. The DropDownList control allows this with it's
    > Value property and I'm wondering how it works...
    >
    > <cc1:tabstrip id="TabStrip1" runat="server">
    > <cc1:Tab TabLabel="One">One</cc1:Tab>
    > <cc1:Tab TabLabel="Two">Two</cc1:Tab>
    > </cc1:tabstrip>
    >
     
    Dave, Aug 2, 2006
    #2
    1. Advertising

  3. Dave

    Dave Guest

    Nevermind...I found the solution here
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/contentrotator.asp

    "Dave" wrote:

    > Actually what I meant to say was the ListItem of the DropDownList control
    > allows it's Text property to be mapped to what ever inner content is defined.
    >
    > <asp:DropDownList ID="ddwn1" runat=server>
    > <asp:ListItem Value="1">One</asp:ListItem>
    > <asp:ListItem Value="2">Two</asp:ListItem>
    > </asp:DropDownList>
    >
    > "Dave" wrote:
    >
    > > Is there a way to put content between tags of a custom control so that it
    > > will populate the defaultproperty such as my TabLabel property? When I tried
    > > to put values between the tags I got the error.
    > >
    > > I have ParseChildren as ParseChildren(true, "Tabs")] where Tabs are part of
    > > a tab strip I declare below. The DropDownList control allows this with it's
    > > Value property and I'm wondering how it works...
    > >
    > > <cc1:tabstrip id="TabStrip1" runat="server">
    > > <cc1:Tab TabLabel="One">One</cc1:Tab>
    > > <cc1:Tab TabLabel="Two">Two</cc1:Tab>
    > > </cc1:tabstrip>
    > >
     
    Dave, Aug 2, 2006
    #3
    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. =?Utf-8?B?RGF2ZQ==?=

    "Literal content is not allowed within a user control"?

    =?Utf-8?B?RGF2ZQ==?=, May 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,115
    =?Utf-8?B?RGF2ZQ==?=
    May 17, 2004
  2. Alan Silver
    Replies:
    1
    Views:
    7,220
    Alan Silver
    Jan 26, 2006
  3. John Smith
    Replies:
    0
    Views:
    4,896
    John Smith
    Jun 6, 2006
  4. John Smith
    Replies:
    0
    Views:
    1,305
    John Smith
    Jun 7, 2006
  5. Ahsan Umair

    Literal content is not allowed within a UserControl

    Ahsan Umair, Jul 16, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    343
Loading...

Share This Page