Link to home
Start Free TrialLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP VBScript - better way of scripting ...

Please can you let me know if there is a better way of scripting these two conditional statements --

        <td class="img-preview-column">
		<% If Not RsImages.EOF then%>
        <% IF RsImages.Fields.Item("image1") <> "" Then %>
            <img src="<%="http://my.website.com/product-images/"&(RsImages.Fields.Item("image1").Value)%>" />
            <% End If %>
            <%End if%>
            </td>
        <td><input name="image2" type="file" id="image2" value="<% If Not RsImages.EOF then%><% IF RsImages.Fields.Item("image1") <> "" Then %><%=(RsImages.Fields.Item("image1").Value)%><% End If %><%End if%>" /></td>

Open in new window


Many thanks
ASKER CERTIFIED SOLUTION
Avatar of pritamdutt
pritamdutt
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of garethtnash

ASKER

Great thank you
Please can I just quickly check this with you both, based on the above logic, will the following work / is the following the best way of writing --

<%
If Not RsImages.EOF then
Image1 = RsImages("image1")
Image2 = RsImages("image2")
Image3 = RsImages("image3")
Image4 = RsImages("image4")
Image5 = RsImages("image5")

IF Image1 <> "" Then
Session("OLDImage2") = (Image1)
End If

IF Image2 <> "" Then
Session("OLDImage3") = (Image2)
End If

IF Image3 <> "" Then
Session("OLDImage4") = (Image3)
End If

IF Image4 <> "" Then
Session("OLDImage5") = (Image4)
End If

IF Image5 <> "" Then
Session("OLDImage6") = (Image5)
End If
End If
%>

Open in new window


Appreciate your help --

Many thanks
Got it - thanks

Ignore last post - unless there is a better way -- TY