How to alter the ImageURL via VB

M

MikeD

Hello,

I'm trying to switch the picture displayed in an asp:image control based on
info obtained from a datatable. If the table contains a value of true then I
wish to display one image or else display the other. The code I have to
perform the test is correct, but it doesn't switch the image url. Here's
what I have so far...

If CurrRows(0)(7).ToString = "True" Then
Me.imgNew.ImageUrl = "images\new.gif"
Else
Me.imgNew.ImageUrl = "images\blank.gif"
End If

This is in VB. If I output the ImageURL as a string to a label it shows
correctly, but dosn't change on the page. The whole lot is within a Repeater
control if that makes a difference.

I don't get any errors but then neither do I get the desired result.

Any thoughts? Please?

<M>ike
 
G

Gerald Klein

I am not a vb person but isnt true a keyword in vb? Could expressing it as a
literal be getting the wrong result?
How is true expressed in the table?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top