InternetUnicodeHTMLCSSScalable Vector Graphics (SVG)Extensible Markup Language (xml)ASP.NetDocument Object Model (DOM)JavaScript ASP ObjectResponse ObjectRequest ObjectServer ObjectApplication Object Draft for Information Only
Content
Session Object
Session ObjectAnother important function of Session object is the control of ASP engine for the HTML output. Session.CodePage PropertyResponse.CodePage property Add or set the CodePage for data in the intrinsic objects within the entire session. Syntax:Session.CodePage(=CodePageID) Or in an ASP file. Imply <% Response.CodePage(=CodePageID) %> Parameters:CodePageID The parameter "CodePageID" is the page code to represent the character code formatting used for the HTML output. The data type of "CodePageID" is integer. The possible CodePageID are
Remarks:The Session.CodePage property is used to specify CodePage of the body content of pages in a session. Each output body content should have only one character set, otherwire the displayed characters will be incorrect. For each character set, there is a corresponding code page to represent the character code encoded in the intrinsic objects. And therefore there is always a code page for every response body output. If Response.CodePage is not explicitly set in a page, the value of CodePage for the page should be determined from other settings. If sessions are enabled, the Response.CodePage can then be implicitly set by the Session.CodePage. If sessions are not enabled and the @CodePage is present in the ASP file, the Response.CodePage can then be set by the @CodePage. If the @CodePage is not present in the ASP file, the Response.CodePage can then be set by the ASPCodePage metabase property. If the ASPCodePage metabase property is also not set or is set to 0, the Response.CodePage is then set by the system ANSI code page. In IIS 5.0 later, Session.CodePage is no longer implicitly set by @CodePage as before. The change was made because @CodePage and Response.CodePage affect only single responses, and Session.CodePage affects all responses in a session. while @CodePage could change the code page for an entire session in IIS 5.0 and eariler version. In the case, the code page is set explicitly in two pages or in two different response outputs with one response output is called by the other response output, through #include, Server.Execute, or Server.Transfer, usually the code page of the child response output will be set by the parent response output. However if a Response.CodePage is explicitly set in the parent page of a Server.Execute call, an @CodePage command in the child page will override the parent code page. So, the explicit setting of Response.CodePage or Session.CodePage for nonliteral strings should be set before senting the output to the client. Besides the encoding of the response output of nonliteral strings in the intrinsic objects, the encoding of the literal strings in a script are still set by the @CodePage if present, the AspCodePage metabase property value if set, or the system ANSI code page with the same priority as for intrinsic objects. Therefore, when both literal and nonliteral strings are used in the same page, the code page setting by @CodePage should match with the code page setting by Response.CodePage, or the page will display incorrectly because the literal strings are encoded differently from the nonliteral strings in the response output. Since the system default code page will be used when there is no code page setting in a web page, sometimes it is not necessary to set a code page in the web page for those web client with matched system default code page. However, setting the code page for a web page is alway necessary for encoding the response output correctly for all web client in the WWW.n the WWW. And therefore if the code page is set in a page, the Response.Charset should also be set in order to ensure the response output is displayed correctly for all web client in the WWW. In order to make the response output display correctly, the file format of a web page must be stored with the same @CodePage setting used in the page. In window, notepad can save files in UTF-8 format or in the system ANSI format. Therefore the ASP file should be saved in UTF-8 format if the @CodePage is set to 65001. Since notepad can save files in system ANSI format according to the default system locale setting in the Regional and Language Options in the Control Panel, notepad can save file in different file format according to @CodePage setting by changing the system locale setting before saving the file. Similarly, in order to test web pages that use different code pages and character sets in a client computer, the corresponding language packs should also be installed through the adding of language packs in the Regional and Language Options in the Control Panel. Examples:
©sideway ID: 120200044 Last Updated: 2/12/2012 Revision: 0 Ref: References
Latest Updated Links
|
Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Reference 79 Computer Hardware 249 Software Application 213 Digitization 32 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 429 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019