473,800 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2070

"hon123456" <pe*********@ya hoo.com.hkwrote in message
news:be******** *************** ***********@y18 g2000pre.google groups.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.Redire ct(), 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.Redire ct() 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
1872
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 offline use, but I have run into a serious problem that I can't solve. innerHTML and outerHTML access the <body> section of the web page under construction, but I was able to hack together some javascript to access the <head> section for the user...
1
3080
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 actually retrieving the content of the object. In trying to use this feature, I'm running into what I think is a bug in httplib.py. If the resource I perform the HEAD request on exists within S3 then everything is fine. If, however, the...
3
2961
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 of the script gets executed. Can someone please give me a direction as to what I may be missing? Thanks.
31
4980
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
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.