Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Are there any ways to remove all the comments from aspx files only in SharePoint Designer? I found that the Optimize HTML in SharePoint Designer only deal with HTML only.

I am also open to any software that is able to help me to remove all the comments from aspx files.

share|improve this question
1  
No. You have to open the files one-by-one and delete the comments. If they aren't accessable through SPD, you have to log onto the server and do the procedure there. –  Daniel Ziga Feb 27 '12 at 3:09
    
@Dandroid, you must be kidding right? I have 50+ files and opening each and every one of them is a pain. –  Jack Feb 27 '12 at 6:15
1  
Nope. Good luck, have fun. –  Daniel Ziga Feb 27 '12 at 10:33
add comment

1 Answer

up vote 2 down vote accepted

The only hope for you is to use Find/Replace command with a robust Regular expression to find the comments and then replace with blank.

I believe SharePoint supports Regular expressions. As an example, I have written an expression that works for simple one line comments as shown below:

enter image description here

The expression I used is:

\<!--[^(--\>)]*--\>

DISCLAIMER: You need to thoroughly test your regular expression before you perform replace function.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.