views:

42

answers:

2

Hi all

I'm attempting to replace a pattern in all my .aspx and .ascx file when I Publish my Webapplication.

When I am running the application locally, I don't care about the replace. But as soon as I need to Publish the solution I need a sequence of characters, let's say "ABC", replaced with "DEF" in all my .aspx and .ascx files.

How would I go about performing this?

A: 

perl -p -i -e 's/ABC/EDF/g' *.aspx

perl -p -i -e 's/ABC/EDF/g' *.ascx

soulonfire
It's not that I don't think that this would work, but Perl isn't quite what I'm looking for in conjunction with Visual Studio 2008.
CodeMonkey
A: 

You should create a separate script, that goes through your folder searching and loading all your .aspx and .ascx files, open them and replace all the needed stuff. I don't know how to do it in asp, but in actionscript it would look like fileText = fileText.replace(/ABC/g,"DEF");

Biroka