Solved

comment out a line of ASP VBScript code

Posted on 2010-08-13
3
630 Views
Last Modified: 2012-05-10
Hello Experts,

I am developing a website that allows the owner to enter their Google Analytics tracking code, without needing to edit the design, IO'm using a database to store the value for the analytics JavaScript and a conditional statement to determine whether to parse the JavaScript -or not--

<% If Florist.Fields.Item("Analytics").Value <> "" then%><%=(Florist.Fields.Item("Analytics").Value)%><%End if%>

As per Googles instructions I'm include the Google JavaScript in this case the variable stored in <%=(Florist.Fields.Item("Analytics").Value)%> just before the closing </head> tag

As per below.

Problem is I'm a split Code View / Design View developer, and when I include this line just before the closing </head> tag, so just after the include CSS tags, It removes all styling from the design view.

To overcome this I have tried storing <% If Florist.Fields.Item("Analytics").Value <> "" then%><%=(Florist.Fields.Item("Analytics").Value)%><%End if%> in an external file and then referencing the file with an include -

<!--#include virtual="/Scripts/analytics.asp" -->

Which works fine, but still leaves me with the style being removed.

Is there something wrong with the way I have built my code below?
Can I comment out the code in - <!--#include virtual="/Scripts/analytics.asp" -->
 in other words the code"<% If Florist.Fields.Item("Analytics").Value <> "" then%><%=(Florist.Fields.Item("Analytics").Value)%><%End if%>" until such time as the design element is complete?

I know it works fine in a browser, just don't really want to keep having to preview in browser..

Any thoughts really appreciated
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><%=(Florist.Fields.Item("metatitle").Value)%></title>

<meta name="language" content="EN" />

<meta name="Keywords" content="<%=(Florist.Fields.Item("metakeywords").Value)%>" />

<meta name="Description" content="<%=(Florist.Fields.Item("metadescription").Value)%>" />

<base href="<%=(Florist.Fields.Item("domainname").Value)%>" />

<link href="/styles/maindesign.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/catalogue.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/footer.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/topnavbar.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/columnnav.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/telefloristfacebooketc.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/paypalbuyflowers.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/orderby.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/topbarcart.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/topphone.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/homepagetext.css" rel="stylesheet" type="text/css" media="all" />

<link href="/styles/specialnav.css" rel="stylesheet" type="text/css" media="all" />

<link href="../WA_eCart/CSS/eC_Simple_Moab_Arial.css" rel="stylesheet" type="text/css" />

<% If Florist.Fields.Item("Analytics").Value <> "" then%><%=(Florist.Fields.Item("Analytics").Value)%><%End if%>

</head>

Open in new window

0
Comment
Question by:garethtnash
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
JayFromPep earned 500 total points
ID: 33429270
Have you tried just commenting out the line?  It should work, but not sure if it will return the stylings.
0
 

Author Closing Comment

by:garethtnash
ID: 33429452
thanks - sometimes you just can't see the forest through the trees
0
 
LVL 5

Expert Comment

by:JayFromPep
ID: 33429746
garethtnash,

know the feeling.  glad I could help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Tool to Build Android and iOS App 3 51
Create html table using xsl 8 28
Issue in webpage 6 34
Bootstrap on PLNKR 3 13
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now