Click here to Skip to main content
16,013,581 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:

C#
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.
Posted
Updated 6-Jul-11 21:49pm
v3

1 solution

Sorry guys. This code works fine the image i was using was just to small fo me to notice it changing.

Thanks anyway guys.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900