views:

38

answers:

3

The following compile error occurs:

Parser Error Message: The 'Text' property of 'asp:ListItem' does not allow child objects.

Source Error:

Line 468: </asp:ListItem>
Line 469: <asp:ListItem Value="3">
Line 470: Search only continuing stories with at least&nbsp; <input runat="server" id="episodetb" Value="0" style="width:50px" />
Line 471: episodes
Line 472: </asp:ListItem>

When my original code is like this:

< asp:RadioButtonList ID="ContStoryRadioButtonList" DataTextFormatString=" {0}" CellPadding="2" runat="server">
<asp:ListItem Value="0">
Search singular and continuing stories
</asp:ListItem>
<asp:ListItem Value="1">
Search only singular stories
</asp:ListItem>
<asp:ListItem Value="2">
Search only continuing stories
</asp:ListItem>
<asp:ListItem Value="3">
Search only continuing stories with at least&nbsp; <input runat="server" id="episodetb" Value="0" style="width:50px" />
episodes
</asp:ListItem>
</asp:RadioButtonList >

Please help me with this. thx in advance

A: 

You can't have HTML in a ListItem, and that's it. You'll have to make your thing out of separate radiobuttons.

Matti Virkkunen
+1  A: 

Unfortunately a ListItem object doesn't have any child controls. You could write your own control doing something similar. Basically you just have to write a <ul> tag with <li/> subitems.

Joachim VR
As I am using asp.net c# so, can you relate your solution with asp.net code? An example will be helpful. thx
Masud Rahman
A: 

You cannot have a server control inside a ListItem. You could have a text control beside the RadioButtonList and fake it, or you could write you own control.

skajfes