gbbosmiya
gbbosmiya

Reputation: 509

how to bind image in image control in asp.net

i want to bind image in image control but according to the value in Eval

if Eval == True then imageurl = "image1" else imageurl = "image"

how to write if condition with eval to get above output

Upvotes: 2

Views: 1539

Answers (1)

asharajay
asharajay

Reputation: 1193

Try

<%#(Eval("Columnname").ToString()=="True")?"Image1.jpg":"Image2.jpg"%>

Upvotes: 1

Related Questions