Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am i blind????? simple code but no clue on whats wrong please help!

Status
Not open for further replies.

hemal666

Programmer
Dec 10, 2001
25
GB
hi i just wrote some simple code for a menu system. It looks straight forward and i cant seem to spot the error. Please help

heres the code:
<%@ LANGUAGE=VBSCRIPT %>
<% Option Explicit %>
<% Response.Buffer = True %>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML>
<HEAD>
<TITLE>P josiah newsagents</TITLE>
<META NAME=&quot;Generator&quot; CONTENT=&quot;EditPlus&quot;>
<META NAME=&quot;Author&quot; CONTENT=&quot;&quot;>
<META NAME=&quot;Keywords&quot; CONTENT=&quot;&quot;>
<META NAME=&quot;Description&quot; CONTENT=&quot;&quot;>
<%
Dim Menuid
'Get value from the query string
Menuid = Request.QueryString(&quot;Menuid&quot;)
%>
</HEAD>
<BODY>
<TABLE Border=&quot;0&quot;>
<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>
<TD>
<CENTER>title</CENTER>
</TD>
</TR>
<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>
<TD>
<A HREF=&quot;index.asp?Menuid=nc&quot; ><IMG SRC=&quot;menuimages/nc.jpg&quot; ALT=&quot;New Clients&quot;></A>
</TD>
<TD>
<A HREF=&quot;index.asp?Menuid=cc&quot; ><IMG SRC=&quot;menuimages/cc.jpg&quot; ALT=&quot;Current Clients&quot;></A>
</TD>
<TD>
<A HREF=&quot;index.asp?Menuid=cu&quot; ><IMG SRC=&quot;menuimages/cu.jpg&quot; ALT=&quot;Contact Us&quot;></A>
</TD>
<TD>
<A HREF=&quot;index.asp?Menuid=sm&quot; ><IMG SRC=&quot;menuimages/sm.jpg&quot; ALT=&quot;Site Map&quot;></A>
</TD>
<TD>
<A HREF=&quot;index.asp?Menuid=hm&quot; ><IMG SRC=&quot;menuimages/home.jpg&quot; ALT=&quot;Home&quot;></A>
</TD>
</TR>
<%
Select Case Menuid
case &quot;nc&quot;
Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;serv.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/serv.jpg&quot; ALT=&quot;Services&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;st.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/st.jpg&quot; ALT=&quot;Search Titles&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;ri.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/ri.jpg&quot; ALT=&quot;Register Interest&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;home.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/home.jpg&quot; ALT=&quot;Home&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;</TR>&quot;)
case &quot;cc&quot;

Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;register.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/reg.jpg&quot; ALT=&quot;Register&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;login.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/login.jpg&quot; ALT=&quot;logon&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;home.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/home.jpg&quot; ALT=&quot;Home&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;</TR>&quot;)

case &quot;cu&quot;
Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;email.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/email.jpg&quot; ALT=&quot;Email Us&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;postal.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/main.jpg&quot; ALT=&quot;Postal address&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;map.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/map.jpg&quot; ALT=&quot;Map&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;home.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/home.jpg&quot; ALT=&quot;Home&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;</TR>&quot;)
case &quot;sm&quot;
Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;sitemap.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/map.jpg&quot; ALT=&quot;Site Map&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;<A HREF=&quot;home.asp&quot; TARGET=&quot;main&quot;><IMG SRC=&quot;menuimages/home.jpg&quot; ALT=&quot;Home&quot;></A>&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;</TR>&quot;)
case Else
Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)
Response.Write(&quot;<TD>&quot;)
Response.Write(&quot;Plaese make a selection from the main navigation above.&quot;)
Response.Write(&quot;</TD>&quot;)
Response.Write(&quot;</TR>&quot;)
End Select
%>
</TABLE>
<IFRAME SRC=&quot;main.asp&quot; NAME=&quot;main&quot; WIDTH=&quot;760&quot; HEIGHT=&quot;300&quot; FRAMEBORDER=&quot;0&quot;>
</BODY>
</HTML>
 
Ok, your problem starts here:
Code:
Response.Write(&quot;<TR WIDTH=&quot;760&quot; HEIGHT=&quot;40&quot;>&quot;)

When the server sees this line it sees The first quote then sees the next quote and thinks your ending the string:
Code:
Response.Write(
Code:
&quot;<TR WIDTH=&quot;
Code:
760&quot; HEIGHT=&quot;40&quot;>&quot;)

What you need to do is either switch those inner quotes to single quotes, like so:
Code:
Response.Write(&quot;<TR WIDTH='760' HEIGHT='40'>&quot;)

Escape them with the escape character for quotes (in this case two double quotes) like so:
Code:
Response.Write(&quot;<TR WIDTH=&quot;&quot;760&quot;&quot; HEIGHT=&quot;&quot;40&quot;&quot;>&quot;)

Or insert the character code for the quote like so:
Code:
Response.Write(&quot;<TR WIDTH=&quot; & Chr(34) & &quot;760&quot; & Chr(34) & &quot; HEIGHT=&quot; & Chr(34) & &quot;40&quot; & Chr(34) & &quot;>&quot;)

you will need to fix all the Response.Write's you have that have inner quotes before this will work.

Other than that it looks good, including the fact that your using my favorite editor to write it in ;)

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top