R
rote
I don't know what i'm doing wrong but i can't get the
<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
in my itemplate to work.
The Select statement is right and it returns data and it also works in EDit
Mode.
But when i use the label with the Title i get the error.
If i type in another property lets say title_id it does work
Any ideas?
<asp:TemplateField HeaderText="Title">
<ItemTemplate>
<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList id="ddlTitle" runat="server"
DataSourceID="sqlDS2"
BackColor="Pink"
DataTextField="Title" DataValueField="Title_ID"
SelectedValue='<%# Bind("Title_ID") %>'>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:SqlDataSource ID="sqlDS2"
Runat="Server"
SelectCommand = "SELECT [Title] FROM [Employee_T] ORDER BY Title"
DataSourceMode="DataSet"
ConnectionString="<%$ ConnectionStrings:MwcConnectionString %>">
</asp:SqlDataSource>
<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
in my itemplate to work.
The Select statement is right and it returns data and it also works in EDit
Mode.
But when i use the label with the Title i get the error.
If i type in another property lets say title_id it does work
Any ideas?
<asp:TemplateField HeaderText="Title">
<ItemTemplate>
<asp:Label ID="Label3" Text='<%# Eval("Title") %>' Runat="Server"/>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList id="ddlTitle" runat="server"
DataSourceID="sqlDS2"
BackColor="Pink"
DataTextField="Title" DataValueField="Title_ID"
SelectedValue='<%# Bind("Title_ID") %>'>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:SqlDataSource ID="sqlDS2"
Runat="Server"
SelectCommand = "SELECT [Title] FROM [Employee_T] ORDER BY Title"
DataSourceMode="DataSet"
ConnectionString="<%$ ConnectionStrings:MwcConnectionString %>">
</asp:SqlDataSource>