InternetUnicodeHTMLCSSScalable Vector Graphics (SVG)Extensible Markup Language (xml)ASP.NetDocument Object Model (DOM)JavaScript ASP Object Draft for Information Only
Content
Response Object
Response ObjectAnother important function of Response object is the output of HTTP headers to the client. As part of the HTTP header, these types of response objects should be sent before sending any body content to the client. Response.ContentType PropertyResponse.ContentType sets the value of content-type header to specify the content type of the HTTP response . Syntax:Response.ContentType [=Content Type] Or in an ASP file. Imply <% Response.Charset = Content Type %> Parameters:Content Type The parameter "Content Type" is the value of the content-type header. The data type of "Content Type" is strings of format "type/subtype" and the value must be enclosed in quotation marks (" "). "type" is the general content category and "subtype" is the specific content type. The possible values of "Content Type" are
Remarks:In general, the default value of the Content Type parameter is "text/html" if there is Content Type property is not set for the page. Since each page can only be assigned to one Content Type, the last instance of Response.ContentType in the HTTP header setting of a ASP file will replace all previous Response.ContentType Setting. If the response buffering is not enbled, the ContentType header setting must be set before any response is sent to the client. Examples:
Response.Charset PropertyResponse.Charset property appends the name of character set to the charset parameter in the content-type header to specify the character encoding of the response contents for the browser. Syntax:Response.Charset (CharsetName) Or in an ASP file. Imply <% Response.Charset = CharsetName %> Parameters:CharsetName The parameter "CharsetName" is the value of the Character set name appended to the charset parameter of the content-type header. The data type of "CharsetName" is strings and the value must be enclosed in quotation marks (" "). The possible values of "CharsetName" are
Remarks:Response.Charset property only appends the specified value to the charset parameter of the content-type header. There is no mechanism to validate whether the specified value represents a valid character set. And there is no browser can understand all character set. Since each page can only be encoded in one charset, the last instance of Response.Charset in the HTTP header setting of a ASP file will replace all previous Response.charset Setting. If the response buffering is not enbled, the Charset header setting must be set before any response is sent to the client. The Unicode encoding, UTF-8 is one of the widely used charset to represent Unicode text in page with mixed languages Besides, the value of CharsetName and value of codepage should match with each other. Since the code page is the value to specify the encoding code page used by the web server to general the response contents, while the character set is the value to specify the decoding character set used by the page browser. Therefore, a codepage setting, by Response.CodePage, Session.CodePage, @CodePage, or AspCodePage, is needed to ensure the readability of the displayed text. And a charsetname setting should also be used to ensure the decoding character set used in client browser match with the encoding code page used in the web server.web server. Name of Character set can refer to http://www.iana.org/assignments/character-sets Examples:
©sideway ID: 120200001 Last Updated: 2/2/2012 Revision: 1 Ref: References
Latest Updated Links
|
Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 7 Reference 79 Computer Hardware 251 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 431 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