在网上搜索了很长时间,大部分要求我修改Web.config文件,其解决方法是传递前用HttpUtility.UrlEncode编码
接收时候用HttpUtility.UrlDecode解码,但作为一个初学者,我不知道去哪里作相应的修改,哪位大虾能否帮忙看
一下,下面我把我的Web.config文件贴出来,希望大家能给我指点一下怎么修改!
下面是我的Web.config文件内容:<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="callConnectionString2" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=info;Persist Security Info=True;User ID=sa;Password=Magic123"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<!--
设置 compilation debug="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<!--<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>-->
</assemblies></compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
-->
<customErrors mode="Off"/>
</system.web>
</configuration>
接收时候用HttpUtility.UrlDecode解码,但作为一个初学者,我不知道去哪里作相应的修改,哪位大虾能否帮忙看
一下,下面我把我的Web.config文件贴出来,希望大家能给我指点一下怎么修改!
下面是我的Web.config文件内容:<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="callConnectionString2" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=info;Persist Security Info=True;User ID=sa;Password=Magic123"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<!--
设置 compilation debug="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为 true。
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<!--<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>-->
</assemblies></compilation>
<!--
通过 <authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--
如果在执行请求的过程中出现未处理的错误,
则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。
-->
<customErrors mode="Off"/>
</system.web>
</configuration>
解决方案 »
- c# FileUpload 图片上传
- asp.net页面用RedirectFromLoginPage登陆,怎么样获取该用户的权限?
- ajxa返回js脚本如何让这个脚本执行?
- sql查询获取值问题
- 求助 牛人帮忙 c# asp.net 弱智问题
- 一个简单的返回值类型问题
- 在运行B/S网站时报这样的错?在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。
- asp.net做类似搜索引擎的项目
- 自定义控件与序列化问题:我自己写了一个Web自定义控件,其中有一个属性叫ObjectName,另一个属性叫DataFields,DataFields是根据OjbectNa
- 小问题:获得datagrid绑定列的名称
- VS2008 login控件关联SQL数据库
- 多谢 多谢 多谢 大家帮忙看看 给点建议◎◎◎◎§§§§§《《《
首先在传递之前先编码:举例如下:
string xm=Server.UrlEncode("张三");
Response.Redirect("b.aspx?xm="+xm); 然后在接收页解码:
string xm = Server.UrlDecode(Request.QueryString["xm"].ToString());
<%# HttpUtility.UrlEncode(Eval("Province").ToString()) %>
在xs里
HttpUtility.UrlDecode(Request.QueryString[""].ToString());