If Then Databind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chateaumiller
    New Member
    • Mar 2007
    • 1

    If Then Databind

    I'm having trouble with this snippet of code.
    All I'm trying to do is match a number from the database to an actual photo. If the photo doesn't exist I want to show a "Not Available" Photo.

    This was very easy for me in ASP Classic, but I am having trouble in .net 2.0

    <% Dim productImage As String
    productImage = "images/products/" & 'DataBinder.Eva l(Container.Dat aItem, "mfgCode")' & "_s.jpg"

    Dim imageFile As New FileInfo(produc tImage)
    If Not imageFile.Exist s Then
    Response.write( "<img src='images/products/na_s.jpg' />")
    Else
    Response.Write( "I Exist")
    end if
    %>

    Any help is appreciated
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    What error are you receiving?

    Comment

    Working...