Three Web. Config problems discovered by building a system framework

Source: Internet
Author: User
------------------------------ <Note: This document is a reprinted article by Huang Yong BLOG> -----------------------------------
Three Web. Config problems discovered by building a system framework
Building a Web system framework according to Microsoft's Duwamish7, although it is said that it is a ready-made framework, but still encountered some annoying small problems, several of which are the ghost of this Web. Config!
1. An error occurred while running the set-up system framework. Why can't I read the ApplicationConfiguration section correctly? But I copied the configuration section from Duwamish7, and it was okay yesterday? I don't remember how long it took, and I think it is impossible to try it for many times. Finally, when I looked at it in a daze, a thought flashed through: ApplicationConfiguration? Too many. Change to AppCofiguration. Try again. Oh, my God! It turned out to be successful! Dizzy!
<ConfigSections>
<Section name = "AppConfiguration" type = "AVWeb. SystemFramework. ApplicationConfiguration, AVWeb. SystemFramework"/>
</<SPAN> configSections>
2. An error occurred when running a comments line in Web. Config. The comments are as follows:
-- Database type 0 -- Access 1 -- SqlServer -->
Because I am not familiar with this, I learned it after a long time: <! The comments contained in --> cannot contain the "--" character.
3. I want to call a calendar control written in Javascript on the page, which contains Chinese comments to include js files in the page, but it cannot be loaded as soon as it is run, I always reported "unfinished string constants" and other errors. After half a day, I realized it was a character set Ghost!
The character set configured in the Web. Config file is very important, that is, <globalization responseEncoding = "gb2312" requestEncoding = "gb2312"/>
If the program contains Chinese characters, but Encoding is not gb2312, there may be many inexplicable problems!
Duwamish7 study notes (2)
SystemFrameWork project
The SystemFrameWork project is a project that can be directly transplanted to other programs. It can be directly used without modifying or rarely modifying code.
The project consists of three classes.
1. ApplicationConfiguration class
This class is an application-level configuration class that implements the IConfigurationSectionHandler interface. Similar to the DuwamishConfiguration class implementation method described above. The main methods are Create (), OnApplicationStart (), and ReadSetting ().
To use this class, you must call ApplicationConfiguration. OnApplicationStart (Context) in the Application_OnStart event of Global. asax );

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.