通常新建asp.net时,我会先设置web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!–设置连接字符串–>
<appsettings>
<add key="connectstring" value="…" />
</appsettings>
<system.web>
<!–设置允许html代码,xml代码等postback–>
<pages validaterequest="false" />
<!–设置trace生效,并输出页面999次,非本地访问也生效–>
<trace
enabled="true"
requestlimit="999"
pageoutput="true"
tracemode="sortbytime"
localonly="false"
/>
<!–设置编码为中文的gb2312–>
<globalization
requestencoding="gb2312"
responseencoding="gb2312"
/>
</system.web>
</configuration>