ASP.NET中继器-图像 [英] ASP.NET Repeater - Images
本文介绍了ASP.NET中继器-图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.
我有一个带有ASP:Image的ASP Repeater,它位于转发器内,而我想做的是更改按钮上的图像,请单击此处,这是我的代码:
Hi guys.
I have an ASP Repeater with an ASP:Image inside the repeater and what I am trying to do is change the image on a button click here is my code:
for (int i = 0; i < repeaterList.Controls.Count; i++)
{
for (int j = 0; j < repeaterList.Controls[i].Controls.Count; j++)
{
var test = repeaterList.Controls[i].Controls[j];
if (test.ID != null && test.ID == "descriptionImage")
{
var test2 = (Image)test;
test2.ImageUrl = "~/images/down-arrow.jpg";
return;
}
}
}
但是单击该按钮时,图像不会改变.
请帮助大家.
预先感谢.
but the imgage does not change when the button is clicked.
Please help guys.
Thanks in advance.
推荐答案
对不起.这段代码可以很好地显示我正在使用的图像,只是使我注意到它在变化.
谢谢大家.
Sorry guys. This code works fine the image i was using was just to small fo me to notice it changing.
Thanks anyway guys.
这篇关于ASP.NET中继器-图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文