ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> ASP Render blocks

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
58 active users
60 visitors today
74 pages today
(only part of today)
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

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

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

A simple, normal, ASP page.

Consider this simple ASP file below:

<%@ Language=JavaScript %>
<html>
<head>
   <title>My page</title>
</head>

<body>   
We're in "HTML mode" here...
<%
   var sScript = Request.ServerVariables ( "SCRIPT_NAME" );

   Response.Write ( '<p>I am called ' + sScript + '<p>' );
%>
...and here.
</body>
</html>

Most of this file is plain HTML. It is simply streamed out to the browser as-is. The section of JavaScript wrapped in a <% %> is called a render block.

Render blocks aren't a terribly good idea. Many ASP examples out there use them, but I'm going to try and persuade you never to use them again. This may be an uphill struggle!

System Inefficiency

Let's bring out the big guns first. Microsoft doesn't think you should use them. They are inefficient because they force the system to constantly switch back and forth between "HTML mode" and "ASP mode". You know how hard it is to work when your kids are playing in the same room? That's what it's like having to stop and output some HTML when you're busy interpreting script.

Since we're not likely to be writing the next eBay any time soon, that might not be the most relevant argument, so let's try another.

Part 2: Wasting Bandwidth...

Featured sponsor
My favorite resources

Selling products online - read how James does it now



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?