473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Asp In Head or Body

Dear all,

I want to know the difference and effect of placing ASP
Code in the begining of .asp File and placing code inside <Head</
HeadTag and Placing code inside <body></bodytag. Just as
follows:

1. Placing code in the Begining of asp file

<% Response.write "Hello" %>

<head>....</head>
<body>....</Body>
2. Placing code in the Head

<head <% Response.write "Hello" %</head>
<body>....</Body>
3. Placing code in Body

<head>.....</head>
<body<% Response.write "Hello" %</body>

Jun 27 '08 #1
2 2058

"hon123456" <pe*********@yahoo.com.hkwrote in message
news:be**********************************@y18g2000 pre.googlegroups.com...
Dear all,

I want to know the difference and effect of placing ASP
Code in the begining of .asp File and placing code inside <Head</
HeadTag and Placing code inside <body></bodytag. Just as
follows:

1. Placing code in the Begining of asp file

<% Response.write "Hello" %>

<head>....</head>
<body>....</Body>
2. Placing code in the Head

<head <% Response.write "Hello" %</head>
<body>....</Body>
3. Placing code in Body

<head>.....</head>
<body<% Response.write "Hello" %</body>
From ASP's perspective <heador <bodyhave no meaning, they are simply
chunks of literal strings that need to be sent to the client. These tags
only have meaning to browser client that is able to a parse HTML.

When outputting HTML whether ASP code that generates content should be in
the head, the body or anywhere else depends on where the content belongs.

For example you would not place code that dynamically outputs HTML table in
the head neither would you place code that dynamically generates meta tags
in the body.

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #2
Anthony Jones wrote:
>I want to know the difference and effect of placing ASP Code
in the begining of .asp File and placing code inside <Head>
</HeadTag and Placing code inside <body></bodytag...

From ASP's perspective <heador <bodyhave no meaning, they
are simply chunks of literal strings that need to be sent to
the client. These tags only have meaning to browser client
that is able to a parse HTML...
While it is true that the ASP parser does not care a whit about the text of
the Response stream, it should be noted that there is at least one
circumstance under which it is imperative that the server-side processing
precede any output.

If the script reaches the decision to send a Response.Redirect(), for
example, the body of the response must be empty. This has been transparent
to most ASP programmers, as buffering has defaulted to [True] since IIS 5.
But in the odd case that buffering is disabled, any Response.Redirect() call
must precede any output to the response body.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: William Starr Moake | last post by:
This may be difficult to understand unless you are familiar with the design mode feature built into Internet Explorer 5.5+. I used this feature to develop a browser-based WYSIWYG HTML editor for...
1
by: Mitch.Garnaat | last post by:
Hi - I'm writing some Python code to interact with Amazon's S3 service. One feature of S3 is that it will allow you to use the HTTP HEAD request to retrieve metadata about an S3 object without...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
31
by: Manfred Kooistra | last post by:
If I have a document like this: <html> <head> <script language=javascript> window.location.href='file.php'; </script> </head> <body> body content
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.