隐藏repeater控件中的image控件
int j=yu.Tables[0].Rows.Count;
for(int i=0;i<j;i++)
{
img=(System.Web.UI.WebControls.Image)Repeater3.Items[i].FindControl("Image1");
if (img.ImageUrl=="")
img.Visible=false;
}
string sql="select *from dbo.testpapercontentlist,dbo.fill where dbo.fill.subjectid=dbo.testpapercontentlist.subjectid and testpaperid='"+Label14.Text.ToString().Trim()+"' order by placeid";
DataSet yu=conn.getresult(sql);
--------------------------2006.12.6---------------------------
本文介绍了一种方法来动态隐藏ASP.NET Repeater控件内的Image控件,当图片路径为空时将其设置为不可见。此外,还展示了如何从数据库检索数据并填充到Repeater控件中。
702

被折叠的 条评论
为什么被折叠?



