the below code will help if the information is coming from a database, if not then try playing round with it to see if you can work it out.
rsNews = select statement
<%if isnull(rsNews("News_Image")) then%>
<img src="images/thumbnails/default image.jpg">
<%else %>
<img src="Image_Display.asp?News_Article_ID=<%=rsnews("News_Article_ID")%>" id="news_image2"
alt="LatestNews" border="0" height="70" name="logo_link0" title="Echo_Images"
width="80" align="middle">
</a>
<%end if %>
or you could always try:
ImageUrl=<%#Eval("iPath")%>
and then on the code begin it would be something like:
Function GetNews() As System.Data.DataSet
Dim dataSet As New DataSet
Dim connectionString As String = "server='xxxxxx';Database='xxxxxx';User ID='xxxxxx';Password='xxxx'"
Dim queryString As String = "SELECT [x], [image], [image_name], [b], [v], [e], [q], [w], [r[t],'' As [iPath],Image_name, (CASE WHEN Image IS NULL THEN 0 ELSE 1 END)as Image_Exists FROM [tblX] WHERE (([Active] = 1)"
Using connection As New System.Data.SqlClient.SqlConnection(connectionString)
Dim adapter As New System.Data.SqlClient.SqlDataAdapter()
adapter.SelectCommand = New System.Data.SqlClient.SqlCommand( _
queryString, connection)
adapter.Fill(dataSet)
For i As Integer = 0 To dataSet.Tables(0).Rows.Count - 1
If (dataSet.Tables(0).Rows(i)("iPath") = "") Then
Dim imgPath As String = ""
imgPath = Request.PhysicalApplicationPath().ToString() + "images\location\" + (dataSet.Tables(0).Rows(i)("Image_name")).ToString()
'imgPath = "http://?????\images\location\" + (dataSet.Tables(0).Rows(i)("Image_name")).ToString()
If (dataSet.Tables(0).Rows(i)("Image_Exists")).ToString = "1" Then
'dataSet.Tables(0).Rows(i)("iPath") = "../images/location/" + (dataSet.Tables(0).Rows(i)("Image_name")).ToString()
dataSet.Tables(0).Rows(i)("iPath") = "../Image_Display.asp?News_Article_ID=" + (dataSet.Tables(0).Rows(i)("News_article_id")).ToString()
Else
dataSet.Tables(0).Rows(i)("iPath") = "../images/location/NOImage.jpg"
' dataSet.Tables(0).Rows(i)("iPath") = "http://?????/images/location/NOImage.jpg"
End If
End If
Next
Return dataSet
End Using
End Function