Microsoft IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationMicrosoft IIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 30th, 2005, 05:46 PM
zomart zomart is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 zomart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 11 sec
Reputation Power: 0
Stripping HTML comments before sending to client

Hey,

I'm looking for a way to have HTML comments stripped
from my server's response before it's sent across to the
client. Basically like this:

Code:
|-----------------|                  |----------------------|
|                 |                  |                      |
|  file on server |  --------------> | data sent to client  |
| (with comments) |                  |  (no comments)       |
|                 |                  |                      |
|-----------------|                  |----------------------|


Any thoughts are appreciated, and any appreciation of
my text art is welcome!

Thanks!

Reply With Quote
  #2  
Old June 30th, 2005, 06:07 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Is this question somehow related to IIS?
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old July 5th, 2005, 12:36 PM
zomart zomart is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 zomart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 53 m 11 sec
Reputation Power: 0
Quote:
Is this question somehow related to IIS?


Well, I figured if it's possible it has to be a server setting and
the server I'm using is IIS. Sorry if it should be somewhere else.

Reply With Quote
  #4  
Old July 5th, 2005, 05:08 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
I don't know of any such IIS setting, but that doesn't mean such a setting doesn't exist.

Reply With Quote
  #5  
Old July 5th, 2005, 05:36 PM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 9
There isn't a setting for that. You'll have to implement it via an ISAPI that handles the outgoing response and does a Regex string operation to remove them.

However, if your pages are already *.asp or *.aspx files, you can do a quickie by replacing this:

Code:
 <!-- this is an SGML comment -->
 


With this:

Code:
 <%-- this is an ASP comment --%>
 


You can easily replace them using some kind of site mangement software that supports "Find and Replace in Files"

"<%--" is the ASP syntax for an ASP comment. You can also use language-specific comment delimiters

Such as:

Code:
 <%'VBScript comment %>
 <%//JScript comment %>
 


HTH

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationMicrosoft IIS > Stripping HTML comments before sending to client


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT