I am using basic ASP and I want to display one of two images depending on the URL of the page. Here's my best shot at it:
<%
Dim myURL
myURL = "https://www.domainname.com:443/Index.asp"
If myURL = "<% response.write(curPageURL()) %>" Then
response.write("<img src="img/image1-logo-150x50.png" width="150" height="50" alt="sitename">")
Else
response.write("<img src="img/image2-logo-80x80.jpg" width="80" height="80" alt="sitename">")
End If
%>
I'm stuck, and can only get a Server Error 500 response for my efforts. Any insights would be greatly appreciated. BTW, I tested <% response.write(curPageURL()) %>
and it does retrieve the page URL in the format shown in my code.
Based on GSerg's link I changed my code to this, but it still doesn't work:
<%
Dim myURL
myURL = "https://www.domainname.com:443/Index.asp"
If myURL = "<% response.write(curPageURL()) %>" Then
response.write("<img src=""img/image1-logo-150x50.png"" width=""150"" height=""50"" alt=""sitename"">")
Else
response.write("<img src=""img/image2-logo-80x80.jpg"" width=""80"" height=""80"" alt=""sitename"">")
End If
%>
Perhaps I misunderstood.
I have corrected the error using response.write, and the server now runs the code; however, the condition is not working. I did a write test on the page URL to get the format that curPageURL() returns, but when I'm on the page that should display image1, it only displays image2. Here's what I'm using:
<%
Dim myURL
myURL = "curPageURL()"
If myURL = "https://www.domainname.com:443/Index.asp" Then
response.write("<img src=""img/image1-logo-150x50.png"" width=""150"" height=""50"" alt=""name"">")
Else
response.write("<img src=""img/image2-logo-80x80.jpg"" width=""80"" height=""80"" alt=""name"">")
End If
%>