Solutions to strange problems with codepage=936-related CSS invalidation in asp.net

Source: Internet
Author: User
Tags character set
asp.net|css| Solution | The problem recently has a simple project on hand, much simpler than usual, but it is not smooth, there are a lot of strange problems, such as today encountered a strange problem, here I talk about solving the whole process.
Customer requirements, when the second item is selected in DropDownList, there is a textbox that is not available, the problem is simple, set the DropDownList AutoPostBack property to "True", Then write the code in the DropDownList SelectedIndexChanged event:

if (ddlframe.selectedindex = 0)//If the first item is selected
{
Txtframeid.enabled = true;
}
Else
{
Txtframeid.text = "";
txtframeid.enabled = false;
}

If it is normal, this way to solve the problem, but today there are strange problems, no matter how I choose DropDownList, it has been refreshed after the first selection, how also choose not the second item, I thought it was DropDownList. The EnableViewState property was set to false, and it turns out that the property value is true, which makes it odd that the second item is not selected.
So I used to write the normal page with Notepad open, to compare the two pages have any difference, found that there is a problem at the top of the page has a word suspicious:

<%@ Page language= "C #" codebehind= "BookInfo.Aspx.cs" autoeventwireup= "false" inherits= "Webs.bookinfo" codepage= " 936 "%>

We must have found that in the end there is a sentence: codepage= "936", what is this thing? I looked up the data and found the conclusion:

<%@ codepage=936%> Simplified Chinese
<%@ codepage=950%> Traditional Chinese
<%@ Codepage=65001%>utf-8

Originally codepage= "936" is the Simplified Chinese, so I will delete it, found DropDownList can select the second item, but the new problem came out: CSS seems to be ineffective, the page becomes very messy. So I switched to VS2003, in Page properties, Set the character set of the page to GB2312, after saving found that the page is normal, and then the Drop-down menu and how to choose All stop on the first item, I suddenly remembered that the Web.config file also has a language set, so I will
<globalization
Requestencoding= "gb2312"
Responseencoding= "gb2312"
/>
These two are set to gb2312, save, found that the page is normal, Drop-down menu can also select the second item, the problem solved, haha!




Related Article

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.