Link to home
Start Free TrialLog in
Avatar of johnnyg123
johnnyg123Flag for United States of America

asked on

Dynamically Change image source

I have an aspx page that has the following

    <div class="StandardDiv"><img src="images/badge_Chrome.gif" alt="Tier Badge" name="img_badge" width="163" height="34" /></div>

In the code behind, I need to change the img src based on the value of field after a query

Select Case rdr.Item("rating")
                    Case 1
                    Case 2
                    Case 3
                    Case 4
                    Case Else
                End Select

Not sure how to do this
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
 Please use

    img_badge.Attributes["src"] = "images/badge_Chrome.gif"

in the code behind