如何在asp.net中的repater中显示图像 [英] how to show image in repater in asp.net
本文介绍了如何在asp.net中的repater中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public void search()
{
conn.Open();
string str1 = "select top 1 Price,Descriptions,Title, Image1 + '~/AdImage/' as url ,descriptions from AdMaster1 order by NEWID()
";
SqlCommand cmd1 = new SqlCommand(str1, conn);
SqlDataAdapter sd1 = new SqlDataAdapter(cmd1);
DataTable dt = new DataTable();
sd1.Fill(dt);
if (dt.Rows.Count > 0)
{
cdcatalog.DataSource = dt;
cdcatalog.DataBind();
}
conn.Close();
}
////////////
转发器代码
////////////
repeater code
<asp:Repeater id="cdcatalog" runat="server">
<ItemTemplate>
<table>
<tr>
<td><b>Price:-<%# Eval("Price")%></b></td>
</tr>
<tr>
<td> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("url") %>' width="200px" height="200px" />
</td>
<td>
<h3> <%# Eval("descriptions")%>]</h3>
</td>
</tr>
<tr>
<td><b> <%# Eval("Title")%></b></td>
</tr>
</table>
{{{{{{{image is not shows,wh ile其他数据显示}}}}}}}
{{{{{{image is not showing,while other data is showing}}}}}}}
推荐答案
HI,这些链接肯定会帮到你。
提前感谢
如何在asp.net& ;;的Repeater Control中显示图像和数据。 c sharp [ ^ ]
C#Corner:错误显示 [ ^ ]
these links will help you surely.
thanks in advance
how to display image and data in Repeater Control in asp.net & c sharp[^]
C# Corner : Error Display[^]
这篇关于如何在asp.net中的repater中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文