troubleshooting Question

Repeater question

Avatar of Dinesh Kumar
Dinesh KumarFlag for India asked on
1 Comment1 Solution353 ViewsLast Modified:
Hi Experts,

How to find the html img tag in the c# and set its url in the rptVehicles_ItemDataBound event of the Repeater?

HTML Code:
<img src='<%# Eval("VendorLogo","~/TAImages/ServiceProviderLogos/{0}")%>' alt="SP" id="imgVendorLogo" />

C# Code:
 RepeaterItem item = e.Item;
        if (item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            Label lblVendorName = (Label)e.Item.FindControl("lblVendorName");
            if (lblVendorName.Text == "ZCars")
                Image vendorlogo = (Image)e.Item.FindControl("imgVendorLogo");
                vendorlogo.ImageUrl = "abc.jpg";

Please help!

I am getting issue in the underlined code i.e not able to access the img tag.

please not its not server site image but html side.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros