0
我有一个asp:repeater
,在中继器中我有一个asp:image
。现在我想通过查找控件访问图像并将图像放入其中。这是我的代码到目前为止。我尝试过但没有成功。 我也试过这个代码在gridview中的另一个地方工作正常。在asp中的图像属性:通过FindControl访问中继器
clsFileUpload fileUpload = new clsFileUpload();
dataTable = fileUpload.GetDownloadsFiles(ClsSystemUsers.ProgramId, ClsSystemUsers.SemesterN, 3);
for (int i = 0; i < dataTable.Rows.Count; i++)
{
//rptLec is my repeater id...
rptLec.DataSource = dataTable;
rptLec.DataBind();
string label = dt.Rows[i]["Url"].ToString();
Image = (Image)rptLec.FindControl("Image_Video");
if (label != null)
{
string turl = label;
GetYouTubeImage(turl);//function for getting image from youtube
}
}
非常感谢...它的工作原理... – Nauman 2014-09-25 09:45:17