VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 commenting out chunks of asp code ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bluesky
VP-ASP Super User

302 Posts

Posted - March 17 2007 :  11:52:38  Show Profile  Reply with Quote
Ok to make a comment in code you simply put an " ' " at the beginning of line

how about easily and quickly blocking out CHUNKS of asp code ? to see how a page/section looks without it ......

IE , below is the stupid waste of space ( IMHO ) header on all the pages .. ok .. i cpuld comment out each line individually to see sitre wihout it ..OR ..OR well ... yes WHAT ? can i do to quickly and easily disable it ( is there a function in dreamwever that comments it out ? after the divs hightlighted ? )

<div id="utilbar">
<table>
<tr>
<td><a href="shopcustadmin.asp<%addSession%>"><%=getLang("langHeadMyAccount")%></a></td>
<td><%welcomenote%></td>
<td class="last">
<form method="post" action="shopsearch.asp?search=Yes" id="form3" name="form3">
<input class="searchfield" type="text" name="keyword" size="19" style="width:100" value="<%=getlang("langsearchboxdefault")%>" onclick="clearfield()" />
<input name="b1" type="submit" value="<%=getlang("langcommonsearch")%>" class="submitbtn" />
</form>
</td>
</tr>
</table>
</div>


PAUL

bluesky
VP-ASP Super User

302 Posts

Posted - March 17 2007 :  12:18:25  Show Profile  Reply with Quote
Sorted this out with some research ... you put the whole chuinks of code in the following
<!-- ... this opens the ignore comment/code
<-- ...this closes it

SEE BELOW

Still dont know if dreamweaver can do this automatically though ?

PAUL

<!--
<div id="utilbar">
<table>
<tr>
<td><a href="shopcustadmin.asp<%addSession%>"><%=getLang("langHeadMyAccount")%></a></td>
<td><%welcomenote%></td>
<td class="last">
<form method="post" action="shopsearch.asp?search=Yes" id="form3" name="form3">
<input class="searchfield" type="text" name="keyword" size="19" style="width:100" value="<%=getlang("langsearchboxdefault")%>" onclick="clearfield()" />
<input name="b1" type="submit" value="<%=getlang("langcommonsearch")%>" class="submitbtn" />
</form>
</td>
</tr>
</table>
</div>
-->

Hope this helps someone like me

PAUL
Go to Top of Page

jdb32
Starting Member

35 Posts

Posted - March 19 2007 :  06:28:32  Show Profile  Reply with Quote
Just a Note:

Yes <!-- --> is the way to comment out HTML code, but if there are any <% %> (This is ASP Code), will still run and are not commented out. You need to comment out the ASP code, easiest way remove the %.

With this line: a href="shopcustadmin.asp<%addSession%>"><%=getLang("langHeadMyAccount")%></a></td>. The function getLang will still run. You can look at the browser source and see the actual text. ASP code is always run before and HTML. The ASP parser goes through the entire code, running anything between <% %> first and then parsing the HTML.

Go to Top of Page

devshb
Senior Member

United Kingdom
1898 Posts

Posted - March 19 2007 :  07:17:14  Show Profile  Visit devshb's Homepage  Reply with Quote
yep; lots of different ways to do it.

what I often do is add an if statement around what I want to temporarily hide/not-do, eg:

<% if 1=0 then %>
all my html code
<% some asp code %>
more html code
<% more asp code %>
<% end if %>

that way it won't matter what gets done in-between (asp or html), it'll still all be hidden/missed-out)

ie add this just above the top of the bit you want to miss out

<% if 1=0 then %>

and add this just below the bottom of the bit you want to miss out:
<% end if %>

then you can change "1=0" to "1=1" if you want to enable it again

But, you do have to be very careful if the bits relate to a form (ie having missing or spurious form tags/fields could cause a lot of problems)

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on March 19 2007 07:19:59
Go to Top of Page

bluesky
VP-ASP Super User

302 Posts

Posted - March 19 2007 :  15:02:20  Show Profile  Reply with Quote
ah!! i am showing my naivity there !!
thnaks very much for reply , i like the end if ideas i will give that a go thnaks simon & co

PAUL
Go to Top of Page

bluesky
VP-ASP Super User

302 Posts

Posted - March 22 2007 :  08:53:06  Show Profile  Reply with Quote
in general this is working to help me , but I have specific probelm i wonder if you can shed light on.

turns out this is being cuased by attempts to remove the horizontal navigation bar in shoppage header ... or disable it without removeing code completely .i was wanting to look at site for a while without this bar but need option to easily put back.

any attempts to remove/comment out this section

<!--START TOP MENU -->
<!--#include file="editor/horonavbar.html"-->
<!--END TOP MENU -->


by
a) simply remove code
b) using '
c) using <!-- -->
d using <% if 1=0 then %> statements

although this does remove the section from being visable , it leaves behind an error ..... shown by a little error box in bottom left of browser .... the jist of it is as follows

line 3
char 2
error 'document.getelementByld(...)'is null or not an object
code :0
URL : http://www mysite etc /shopcontent/home

I opened a ticket at helpdesk but they suggested I remove the code completley ( which doesnt work ..see above ) and closed ticket .

can anyone else replicate this error ? as helpdesk said they couldnt ..yet its happening on 3 different computers for me ......2 x IE6 and 1 x IE7

Any thoughts appreciated

PAUL



PAUL

Edited by - bluesky on March 22 2007 09:23:58
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000