Win7 iis7.5 garbled code and solutions for connecting asp ado to the database

Source: Internet
Author: User

Do you find garbled characters appear when you refresh your website? Well, let's talk about the solution here... First of all, let's talk about the first problem. It was just a bit confusing at the beginning. But what I found was a coincidence, because I installed Asp.net directly at the beginning of iis7.5, although I didn't know this knowledge, I still found that the Asp.net configuration process will generate a so-called web under the Web root directory. config. At that time, I thought this file was strange, so I deleted it directly. Then I ran my ASP file and found that the problem had been converted into an ODBC connection error, but there was still a lot of garbled characters .. If you don't want to talk nonsense, solve the second problem. The second problem is caused by ASP error-encoding. The solution is as follows:
1. Copy the c: \ Inetpub \ custerr \ ZH-CN \ 500-100.asp file to your site folder. Maybe someone may wonder why not modify it directly, this is because you have some permission problems. Of course, you can try to get the permission and modify it directly.
2. Change the file to UTF-8 encoding:
A. <% @ Language = "VBScript"> changed to <% @ Language = "VBScript" @ codePage = 65001%>
B. Add a line of response. charset = "UTF-8" after option explicit"
C. <meta HTTP-EQUIV = "Content-Type" content = "text/html; charset = gb2312"> change to <meta HTTP-EQUIV = "Content-Type" content = "text/html; charset = UTF-8 ">
D. Add session. codePage = 65001 after bakcodepage = session. codePage (of course, it can be any location. Do not use the first line)
3. Configure iis7.5
A. Open iis7, select the site you created, double-click the "error page" icon in the right window, and select "add..." under the right property window
B. In the add custom error page window, the status Code "500.100", select "execute URL on this website", URL address "./500-100.asp"
4. After confirmation, the error information displayed on the site will be described in detail and no errors will occur.

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.