If you go to Build-> Publish Web Site menu on Visual Studio 2005, you will find this publishing screen:

If you UNCHECK the "Allow this precompiled site to be updatable", all the aspx pages within the projects will be generated empty. To be more exact, you will find the following unique line on them:

This is a marker file generated by the precompilation tool, and should not be deleted!

If you compare this screenshot:

with this one:

you will realize how the first was published allowing ASPX pages to be updated and the second not (notice how in second screenshot, all the ASPX files have 1kb file size)

Don't worry!, All HTML markup and inline code is compiled into assemblies on the bin folder, and it is correctly executed and rendered when the page is requested.

This way, nobody would be able to change either code or HTML content after the publishing is done!

kick it on DotNetKicks.com AddThis Social Bookmark Button

Saturday, November 28, 2009 1:28:53 PM UTC
Just testing the Akismet anti SPAM key...
ivan
All comments require the approval of the site owner before being displayed.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, em, i, strike, strong) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview

Yeap, the sponsors! :-)

On this page...

Tags

Calendar

<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Navigation

Archives

Recommended .NET blogs

The author

Iván Loire
Iván Loire (Zaragoza, Spain)

View Ivan Loire's profile on LinkedIn
Microsoft Certified Trainer
Send mail to the author(s) E-mail

Syndication

Feed Icon