Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

how does #Include work?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Fish - 20 Oct 2005 13:34 GMT
Hi,

In an asp.net application, I have seen some lines like this:

<!-- #Include File="xyz.html" -->

and I can see what happens when the included file contains just text and
html, but I can't find any documentation on msdn about this and I'm trying
to find out how it is processed. Specifically:

1. is the #include processed by the browser, by asp.net, or by IIS?
2. at what point in the page lifecycle is it processed?
3. where is the documentation for it?

TIA for any clues.

Andy
Curt_C [MVP] - 20 Oct 2005 13:39 GMT
It's a throwback to the ASP days and really not that handy. A control will do
you better. Anyway, INCLUDES are pulled into the page PRIOR to ANY parsing,
so they cant use any variables, etc.

Signature

Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

> Hi,
>
[quoted text clipped - 13 lines]
>
> Andy
Patrice - 20 Oct 2005 13:49 GMT
See :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/c
pconServer-sideIncludeDirectiveSyntax.asp


This is server side and processed very early (AFAIK even before creating the
page as its "text" must be known before).

Under .NET this is likely there for legacy. Depending upon what you are
doing, you could use for example "user controls" instead...

Signature

Patrice

> Hi,
>
[quoted text clipped - 13 lines]
>
> Andy
Andy Fish - 20 Oct 2005 14:12 GMT
Thanks for these replies, especially the MSDN link (I was only looking at
asp.net directives so I missed it)

I wanted to have the asp.net logic decide which file to include so obviously
this is no good for my purposes. I'll dynamically load a web user control
instead.

Andy

> See :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/c
pconServer-sideIncludeDirectiveSyntax.asp

[quoted text clipped - 24 lines]
>>
>> Andy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.