473,388 Members | 1,327 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,388 software developers and data experts.

#include and <script runat="server">

There seem to be two ways to include files on the server:
1. <!-- #include file="header.inc" -->
2. <script language="VBScript" runat="server" src="header.inc"></script>

What are the differences between the two, and when to use one instead of the
other?

Thanks.
Jul 19 '05 #1
3 9358
1) is included PRIOR to the server parsing the page.
2) is done AFTER

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Michael" <a@b.c> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
There seem to be two ways to include files on the server:
1. <!-- #include file="header.inc" -->
2. <script language="VBScript" runat="server" src="header.inc"></script>

What are the differences between the two, and when to use one instead of the other?

Thanks.

Jul 19 '05 #2
So option 2 will have to contain only scripts, no HTML; except if used like
Response.Write("<div>")?
"Lance Wynn" <la********@hotmail.com> wrote in message
news:OF*************@TK2MSFTNGP10.phx.gbl...
Also, with number 2, can you use <% %> tags within the file? I don't think you can, but I may be wrong.
"Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
news:ut**************@TK2MSFTNGP10.phx.gbl...
1) is included PRIOR to the server parsing the page.
2) is done AFTER

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Michael" <a@b.c> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
There seem to be two ways to include files on the server:
1. <!-- #include file="header.inc" -->
2. <script language="VBScript" runat="server" src="header.inc"></script>

What are the differences between the two, and when to use one instead of

the
other?

Thanks.


Jul 19 '05 #3
IIRC you can use <% %> but this script page is independant of the original
since the client is requesting it, not the server

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Michael" <a@b.c> wrote in message
news:Oj**************@TK2MSFTNGP10.phx.gbl...
So option 2 will have to contain only scripts, no HTML; except if used like Response.Write("<div>")?
"Lance Wynn" <la********@hotmail.com> wrote in message
news:OF*************@TK2MSFTNGP10.phx.gbl...
Also, with number 2, can you use <% %> tags within the file? I don't

think
you can, but I may be wrong.
"Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
news:ut**************@TK2MSFTNGP10.phx.gbl...
1) is included PRIOR to the server parsing the page.
2) is done AFTER

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"Michael" <a@b.c> wrote in message
news:eg**************@TK2MSFTNGP11.phx.gbl...
There seem to be two ways to include files on the server:
1. <!-- #include file="header.inc" -->
2. <script language="VBScript" runat="server" src="header.inc"></script>
What are the differences between the two, and when to use one instead
of the
other?

Thanks.



Jul 19 '05 #4

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

Similar topics

1
by: Hai Nguyen | last post by:
Hi all I have a several User Controls which require this tag: "<form runat="server">. I tried to have all of these user user controls on the same web page. It kept giving me an error :""A page...
4
by: Tim Mulholland | last post by:
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file just fine. I have another page where i've done...
1
by: Mark Sandfox | last post by:
Is there a way to restrict the user to only selecting and sending either a ..gif or .jpg. Everything I have read says this option can not be done by design (security reasons). I find that irronic...
3
by: Jaime Stuardo | last post by:
Hi all... Both controls are server side. The former has more properties. Both may have associated events that are ran at server. Which one are recommended to use? is performance an issue? in...
3
by: Jim in Arizona | last post by:
Most of the asp.net learning I've done has been from books that were written during the 1.0 framework. I didn't have a copy of visual studio when I started reading them then I got a hold of VS 2005...
0
by: Tom | last post by:
I need to use DynamicHoverStyle. I read that in order to do so, I must add a <head runat="server" /> at the top of my UserCOntrol. When I do this though, my DynamicMenuItemStyle items get...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
1
by: mark4asp | last post by:
<form runat="server"automatically adds <divtag to code contained within. Is there a way to stop that? Mixing block-level elements with inline-level elements messes up the HTML becasuse that is...
19
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...

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.