hi
I used image control in datalist :
<asp:DataList ID="DLrandom" runat="server" RepeatDirection="Horizontal" CssClass="dLrandom">
<ItemTemplate>
<div id="random">
<asp:Image ID="Imgrandom" runat="server" ImageUrl='<%#Eval("image","image/Documentry/{0}")%>'></asp:Image>
</div>
<div id="imgM1">
<asp:Label ID="Label18" runat="server" Text='<%# Eval("SectionName") %>' CssClass="lblRname"></asp:Label>
</div>
</ItemTemplate>
</asp:DataList>
and I have linkbutton in page that bind it from database when I click on linkbutton it make below error:
Server Error in '/' Application.
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Source Error:
Line 374: <ItemTemplate>
Line 375: <div id="random">
Line 376:<asp:Image ID="Imgrandom" runat="server" ImageUrl='<%#Eval("image","image/Documentry/{0}")%>'></asp:Image>
Line 377:
Line 378: </div>
|
what should I do?
est regards
neda