473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HTML Link in ASP VBSCRIPT block

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
%>
Aug 8 '08 #1
2 1909
<re*****@gmail.comwrote in message
news:8c**********************************@r66g2000 hsg.googlegroups.com...
I haven't done ASP in a long time, and I think I'm forgetting
something.
You're also in the wrong newsgroup - this one is for ASP.NET.

For ASP, please post to: microsoft.public.inetserver.asp.general
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 9 '08 #2
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

<re*****@gmail.comwrote in message
news:8c**********************************@r66g2000 hsg.googlegroups.com...
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
%>
Aug 9 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
16
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript...
3
by: =?Utf-8?B?Sm9obkhvcmI=?= | last post by:
I have a problem with client-side VBSCRIPT on a page with auto-postback controls. I have generated a simple page with a listbox, set to autopostback. This works OK. If I then generate some...
0
by: BooGhost | last post by:
Some background: 1. I've got a master page with an asp:Menu using an XML sitemap. 2. A page that uses the master page has an object tag (instancing an activex control) 3. This activex control...
18
by: requeth | last post by:
I'm trying to do the following, but when I have the code in for hte HREF link I get a runtime error. How do I pass the link to the end user? <% Dim a as string Dim b as string a =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.