@ directive Reference

Source: Internet
Author: User
Tags character set comments contains iis locale valid
Reference you can use the @ directive in your script to send information about how to process an. asp file to IIS. For example, the following script uses @LANGUAGE processing instructions to set the scripting language to VBScript.

<% @Language =vbscript
Dim MyVar
Application ("myvar") = this was my var
Response.Write (MyVar)
%>

In IIS 4.0, Active Server Pages (ASP) supports the following five @ directives.

@CODEPAGE

@ENABLESESSIONSTATE

@LANGUAGE

@LCID

@TRANSACTION


--------------------------------------------------------------------------------

@CODEPAGE
You can use the @CODEPAGE directive to set up code pages for. asp files. A code page is a character set that includes numbers, punctuation marks, and other characters. Different language and locale with different code pages. For example, ANSI code page 1252 is used for U.S. English and most European languages, and OEM code page 932 is used by Japanese characters.

A code page can be represented as a map of a character to a single byte value or a multibyte value. Many code pages share the ASCII character set between 0x00-0x7f.

The code page set by the @CODEPAGE directive can be ignored by the Session.CodePage property. However, the result of doing so applies only to scripts that run in the session scope.

Grammar
<%@ codepage=codepage%>

Parameters
CodePage
Unsigned integer representing the valid code page for the system running the ASP script engine.
Please see
Session.CodePage


--------------------------------------------------------------------------------

@ENABLESESSIONSTATE
You can use @ENABLESESSIONSTATE directives to turn off Web session tracking. Session tracking maintains a set of request information that is published by a single client. If your Web page does not rely on session information, turning off session tracking can reduce the time that IIS processes scripts.

Grammar
<%@ enablesessionsstate=true| False%>

Comments
For more information about session tracking, see Managing Session State


--------------------------------------------------------------------------------

@LANGUAGE
You can use @LANGUAGE directives to set the language used to interpret commands in the script. You can set your scripting language to any of the scripting engines that are installed in IIS. The default setting is VBScript, so if you do not include @LANGUAGE in the script, the script will be interpreted by the VBScript engine.

Grammar
<%@ Language=scriptengine%>

Parameters
ScriptEngine
Script engine that compiles the script. IIS contains two scripting engines, VBScript and JScript.
Comments
You can use the AspScriptLanguage property of the IIS Admin object to change the default scripting language. You can apply this attribute to a Web service, a Web server, a virtual directory, or a web directory. For more information, see IIS Admin object.


--------------------------------------------------------------------------------

@LCID
You can use the @LCID directive to set the field identity (LCID) for the script. The LCID data type is DWORD, the low word is the language identity, and the high word retention. The LCID identifier is represented by a digital abbreviation of international standards. The LCID has a unique component that identifies the installed System definition site. There are two predefined LCID values, Locale_system_default is the default locale of the system, Locale_user_default is the current user site.

Grammar
<%@ Lcid=localeidentifier%>

Parameters
Localeidentifer
A valid field identification.
Please see
Session.LCID


--------------------------------------------------------------------------------

@TRANSACTION
You can use @TRANSACTION instructions to indicate that the script should be handled as a transaction. If the script is treated as a transaction, Microsoft Transaction Server (MTS) creates a transaction to coordinate the update of the resource.

Grammar
<%@ Transaction=value%>

Parameters
Value
A string indicating the transaction support type, which may be value: value meaning
The Required script Initializes a transaction.
The requires_new script Initializes a transaction.
The supported script will not initialize a transaction.
The not_supported script will not initialize a transaction.


Comments
If the script contains @TRANSACTION directive, it must be in the first line of the. asp file, otherwise an error will occur. You must add the directive to every page that you want to run under a transaction. When the script is processed, the current transaction is finished.

Please see
ObjectContext



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.