In previous versions of ASP, it was possible to place a single directive on the first line of a page. For example:
В | Copy Code |
---|---|
<%@LANGUAGE="VBScript" CODEPAGE="932"%> |
Several new directives have been added to ASP.NET. The Language attribute must now be placed within an
В | Copy Code |
---|---|
<%@Page Language="VB" CodePage="932"%> <%@OutputCache Duration="10 VaryByParam="location"%> |
For migration purposes, the following shorter ASP–style syntax is also supported for the
В | Copy Code |
---|---|
<%@ Language="VB" CodePage="932"%> <%@OutputCache Duration="10 VaryByParam="location"%> |
Directives can be located anywhere in an .aspx file, but standard practice is to place them at the beginning of the file. Case is not important in ASP.NET directive statements, and quotation marks are not required around the attribute values. The
В | Copy Code |
---|---|
<%@PAGE LANGUAGE=VB CODEPAGE=932%> |
For more information about the new directives and their attribute sets, see