I'm still coding in VS 2003, ASP.NET 1.1 because I work in the public sector and we have no money for training. I have one line of code, that calls one function that already works perfectly in other applications, but I cannot find one difference to figure out why it's not working here. The code uses a function to return an image.
The .apsx page reads:
<asp:Image Runat="server" Width="100" AlternateText="Photo Unavailable" ImageUrl='<%# GetImg(Container.DataItem(
"ImageID")
) %>' ID="Image1" ></asp:Image>
The Function looks like this:
Public Function GetImg(ByVal sImg As Object) As String
Try
With sImg
If sImg Is DBNull.Value Then
sImg = "Imgs\nophoto.gif"
Else
sImg = "
http://www.hcso.org/Records/Images/" & sImg & ".jpg"
'Response.ContentType = "image/jpeg"
'Response.BinaryWrite(sImg
)
'Response.End()
End If
End With
Return sImg
lblError.Text = sImg
Catch ex As Exception
lblError.Text = ex.ToString
End Try
End Function
Does anyone see any reason why this would not work like in the other apps???
Thank you!