对Bind的调用格式不正确。请参阅文档以获取正确的Bind参数?

时间:2013-07-06 16:28:32

标签: c# javascript asp.net

<asp:DataList ID="dtlist" runat="server" RepeatColumns="4" CellPadding="5">
    <ItemTemplate>
        <asp:Image Width="100" ID="Image1" ImageUrl='<%# Bind("~/sqldread2/{0}") %>' runat="server" />
        <br />
    <ItemStyle BorderColor="Brown" BorderStyle="dotted" BorderWidth="3px" HorizontalAlign="Center" VerticalAlign="Bottom" />
</asp:DataList>
  

错误 - 数据绑定格式不正确。

我想打印下面的图像数组。 我想我要将sqldread2添加到DataListGridViewListView

while (sqldread2.Read())
{
    Context.Response.BinaryWrite((byte[])sqldread2["Image"]);
    Context.Response.ContentType = "image/jpg";

    al.Add(sqldread2);
    sDatAdp.SelectCommand = scmd1;

    dtlist.DataSource = sqldread2;
    dtlist.DataBind();
}

0 个答案:

没有答案