473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

cannot have children of type 'DataBoundLiteralControl'

I am using the DataList
The ItemTemplate has a button and a label. The label field is bound to
a datatable and a field called "Narrative". The button is labeled
"Edit". When the edit button is clicked, the edit Template displays a
number of buttons and it attempts to display that "Narrative" in a text
box, allowing the user to edit the text of the narrative.

When I run and press the "Edit", the system stops in the Edit Template
and highlights the "Narrative" text box control and gives me the
following error message "System.Web.HttpException: 'TextBox' cannot have
children of type 'DataBoundLiteralCont".

Why does it not like me using the same field again with a textbox
control?
Here is my itemTemplate

<ItemTemplate>
<asp:Button Text="Edit" CommandName="Select" Runat="server">
</asp:Button>
&nbsp;<asp:Label ID="lblDesc" Runat="server">
<%# DataBinder.Eval(Container.DataItem, "Narrative" ) %>
</asp:Label>

</ItemTemplate>

Here is my EditTemplate

<EditItemTemplate>
<asp:Button CommandName="Update" Text="Update" Runat="server">
</asp:Button>
<asp:Button CommandName="Delete" Text="Delete" Runat="server">
</asp:Button>
<asp:Button CommandName="Cancel" Text="Cancel" Runat="server">
</asp:Button><br>
Sequence
<asp:TextBox><%# DataBinder.Eval(Container.DataItem,"Seq")%>
</asp:TextBox>
Bullet Type
<asp:DropDownList Runat="server">
<asp:ListItem>Header</asp:ListItem>
<asp:ListItem>Bullet</asp:ListItem>
</asp:DropDownList>
&nbsp;
***** This is where it bombs off **********************
<asp:TextBox Runat="server" ID="txtNarrative">
<%# DataBinder.Eval(Container.DataItem, "Narrative") %>
</asp:TextBox>
</EditItemTemplate>
Nov 18 '05 #1
0 1790

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tim Cartwright | last post by:
I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web...
2
by: Sharon | last post by:
Hi all. I have a console app which is a remoting server. When trying to access the server using console app client, it works fine. But when i try the same client code from aspx page on iis i get...
2
by: Paul Hemans | last post by:
I am very new at .Net. I have a small project where I need to manipulate the contents of a web page. I have a form with a web browser control (webBrowser1) on it. Within the...
2
by: keithb | last post by:
A web site published from its development environment (VS Web Server) to an IIS 6.0 site displays this message: Compiler Error Message: CS0030: Cannot convert type 'ASP.login_aspx' to...
2
by: Marcelo Muzilli | last post by:
Howdy all, in my program, I have a ushort variable and a string variable and if I try to compile it, I'm receiving this error message: "Cannot convert type 'string' to 'ushort'". How can I...
6
by: John | last post by:
The following code: int test = 1; bool isTrue = (bool)test; results in a compiler error: Cannot convert type 'int' to 'bool' wtf, any ideas on how to work around this?
1
by: niharnayak2003 | last post by:
Hi All, I am facing the problem in Typecast inside the Generic class. I need a function which will take two param 1:-Xpath 2:- XMLDOC and return me what i will need. here is the code for...
2
by: Paulo | last post by:
DataRow dr = (DataRow)ds.Tables.Rows.ItemArray; Error 1 Cannot convert type 'object' to 'System.Data.DataRow' C:\Documents and Settings\Fabio\Meus documentos\Visual Studio...
2
by: nomad | last post by:
Hi, When trying to serialize a class I keep getting the message below. optionalExtensionTypeOptionalExtension is not mandatory so not sure why this is appearing. If anyone has seen this type...
3
by: abhijit mudugan | last post by:
i'm getting an error 'identifier display cannot have type qualifier' near the bold portion. what's wrong??? #include<iostream.h> #include<conio.h> #include<stdio.h> #include<stdlib.h> class...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.