asp.net.ph

Skip Navigation Links

Server-side Include Directives — global.asax

ASP.NET Syntax   Global.asax Syntax


Insert the raw contents of a specified file anywhere within an ASP.NET application file.

<!-- #include pathtype = filename -->

Parameters

pathtype
The type of the filename path. The path type can be one of the following:
  • File - The file name is a relative path from the directory containing the file with the #include directive. The included file can be in the same directory or in a subdirectory; it cannot be in a directory above the file with the #include directive.
  • Virtual - The file name is a full virtual path from a virtual directory on your Web site.
filename
The name of the file to be included. filename must contain the file name extension, and you must enclose the file name in quotation marks ( " ).

Remarks

The included file is processed before any dynamic code is executed. The #include tag must use HTML/XML comment delimiters so as not to be interpreted as static text.

Syntax Example

The below code snippet demonstrates including a file named myHeader.inc in a Web Forms page.

<!-- #include File = "myHeader.inc" -->
See Also

ASP.NET Applications



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note