Wife/Girlfriend/Sister?
Pepper Spray &
Stun Gun Specials!
KEEP THEM SAFE.
 CoverYourASP --> ASP Render blocks --> Part 3

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
34 active users
1880 visitors today
2451 pages today
(only part of today)
Tools I use

CoverYourASP
Copyright © 1999-2010 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

But what about readability?

Ok, let's say you're with me on the bandwidth issue. But now the code isn't readable, right? Here's the real answer (using my Out function to wrap Response.Write):

<%@ Language=JavaScript %>
<%
// the statement below enables buffering of the data sent to the browser.
// see http://learnasp.com/learn/whybuffer.asp
%>
<% Response.Buffer=true %>

<%
   Out ( '<html>' );

   Out ( '<head>' );
      Out ( '<title>My page</title>' );
   Out ( '</head>' );

   Out ( '<body>' );

      Out ( 'We're in "HTML mode" here...' );

      // output the name of the script itself
      var sScript = Request.ServerVariables ( "SCRIPT_NAME" );

      Out  ( '<p>I am called ' + sScript );

      Out ( '<p>...and here.' );
      
   Out ( '</body>' );
   Out ( '</html>' );
%>

Indentation, comments, efficiency. What more could you possibly want? You want MORE?

Part 4: Security...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...

CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?