Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

Do you know how I can resolve the error 'asp:ListItem' does not allow child objects. This occurs in an ASPX file when using VS2010 and C#?.

I am writing an application in ASP.NET using C# and Visual Studio 2010.
Do you know how I can resolve the following error in my .ASPX file as follows:

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

-----------

<ItemStyle HorizontalAlign="Left"></ItemStyle>
                 </asp:TemplateField>

                <asp:TemplateField HeaderText="How Received" ItemStyle-HorizontalAlign="Left">
                    <EditItemTemplate>    
                   
                  <asp:DropDownList ID="drpRecv" Width="60px" runat="server" SelectedValue='<%#Eval("howRecieved") %>'>
                                            <asp:ListItem Value="Bits"></asp:ListItem>  
                                            <asp:ListItem Value="E-Mailed"></asp:ListItem>
                                            <asp:ListItem Value="Faxed"></asp:ListItem>
                                            <asp:ListItem Value="Mail">/asp:ListItem>                                                                                                                                                                      
                  </asp:DropDownList>  
                                   
                  </EditItemTemplate>
                  <ItemTemplate>
                       <asp:Label ID="lblhowRecieved" runat="server" Text='<%# Eval("howRecieved") %>'></asp:Label>
                  </ItemTemplate>
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial