The object does not support this attribute or method: 'response. charset'

Source: Internet
Author: User
Tags servervariables
[Reprinted] The object does not support this attribute or method: 'response. charset' is a web system developed for the customer. It was originally planned to run in IIS, but the client's computer OS IIS could not be installed in any way, I cannot ask the customer to reinstall the operating system for this web system? So I thought Netbox .

during development, debugging is performed under IIS and then run with netbox. Basically, everything works normally. After a period of time, the customer proposes to add a new function, therefore, a new function is added with Ajax. An error occurs during netbox running.
error message:
runtime error '800a01b6 '
the object does not support this attribute or method: ' response. charset'

-----------------------------------------------------------------
(Baidu, many people may encounter the same error)
Microsoft VBScript runtime error '800a01b6 '
Object doesn' t support this property or method:' response. charset'

check for error Code :
response. charset = "gb2312"

This line of code is mainly used to solve the problem of Chinese garbled characters when Ajax obtains data using get.
After this line of code is deleted, netbox runs normally, but Chinese data returned by Ajax becomes garbled.
DescriptionNetbox not supportedResponse.Charset.

Open the netbox user manual and expand it one by one:
Object Reference → response object → RESPONSE METHOD
Addheader Method
The addheader method adds the HTML title with the specified value. This method often adds a new HTTP title to the response.
Syntax
Response.Addheader name, Value
Parameters
Name
Name of the new title variable
Value
Initial values stored in the new title variable
Note
To avoid ambiguous names, the name cannot contain any underscore (_). The servervariables set interprets the underline characters in the title as a backslash. For example, the following script allows the server to search for a title named my-header.

<% Request. servervariables ("http_my_header") %>
Example
The following example uses the addheader method to require the client to use basic verification.

<%Response.Addheader "www-authenticate", "Basic" %>
Note that the preceding script only notifies the client browser of which verification is used. If your Web ApplicationProgramTo use this script, you must enable basic verification for the Web server.

Therefore
Response.Charset = "gb2312"
Replace:
Response.Addheader "Content-Type", "text/html; charset = gb2312"

In the netbox environment, Ajax uses get to get data and solves Chinese garbled characters!

Source: http://hi.baidu.com/luckcx/blog/item/496238014562620d7bec2c88.html

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.