HTML Link in ASP VBSCRIPT block

R

requeth

Hey, I havnt done ASP in a long time, and I think I'm forgetting
something. I have the following block, and it runs fine s long as the
HTML link code isint in, but if I put the code in I get a runtime
error. How do I get the HTML link to work?

<%
Dim a as string
Dim b as string
a = request.browser.browser
b = "IE"
if a <> b then
response.write( "You are using " & a & " to view this page. Please use
Internet Explorer.")
else

<a href="http://example.com/index.aspx">
<img src="./button.jpg" border="0">
</a>

end if
%>
 
M

Mark Fitzpatrick

You have to terminate the code block before you do the html. it
should be:

else %>
<a href="http://example.com/index.aspx"><img src="./button.jpg"
border="0"></a>
<% end if %>

The HTML should never be part of the vbscript code unless you are using a
response.write to output it to the browser.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top