這個是我在開發中總結出來的web.config版,最簡單,也最适用各種情況,避免出現httpRuntime錯誤和request.form危險等情況的出現
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime requestValidationMode="2.0"/>
<customErrors mode="Off"/>
<pages validateRequest="false"/>
</system.web>
</configuration>