URL编码处理
来源:互联网 发布:苹果7支持4g十网络吗 编辑:程序博客网 时间:2024/05/23 18:17
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
将下面的URL作为一个参数传到其他的页面
1 http://domain/de.apx?uid=12&page=15
2 URL后面的参数中出现汉字等,如: ....aspx?title=起重机
在出现上面的情况的时候,必须经过一个RUL编码和解码的过程,否则会出现错误.
代码如下:
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
要解决的问题:将下面的URL作为一个参数传到其他的页面
1 http://domain/de.apx?uid=12&page=15
2 URL后面的参数中出现汉字等,如: ....aspx?title=起重机
在出现上面的情况的时候,必须经过一个RUL编码和解码的过程,否则会出现错误.
代码如下:
1//传值
2string temp = " <a href='Add.aspx?URL=" Server.URLEncode( skin.Page.Request.URL.AbsoluteUri ) "&title=" Server.URLEncode( skin.Page.Header.Title ) "'>添加到收藏夹</a>");
3
4//在另外一个文件中取从上面传的值
5if (Request.QueryString["URL"] != null)
6 {
7 string URL = Server.URLDecode(Request.QueryString["URL"].ToString());
8 this.txtAddress.Text = URL;
9 }
10 if (Request.QueryString["title"] != null)
11 {
12 string title = Server.URLDecode(Request.QueryString["title"].ToString());
13 this.txtTitle.Text = title;
14 }
http://www.cnblogs.com/waitu/archive/2006/08/15/477123.html
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- URL编码处理
- URL编码处理
- URL编码处理
- url编码 处理特殊符号
- URL的编码处理
- ASP.NET URL编码处理
- python处理浏览器URL编码
- 处理URL编码与解码
- URL 编码 前台处理,后台解码JAVA
- asp.net url编码问题处理
- encode url 编码和解码处理
- URL中带汉字的编码处理
- encode url 编码和解码处理
- Delphi中处理URL编码解码
- url编码与utf8编码转换问题处理
- url编码
- URL编码
- URL编码
- ASP.NET实现下拉框二级联动组件
- 如何解决Remoting无法传输存储过程参数的问题
- 在ExcuteReader中使用输出参数的问题
- asp.net错误处理封装
- 使用UTF-8编码/JMail组件发送邮件乱码问题
- URL编码处理
- Web导出Word需要添加头文件
- ASP.NET页面的处理过程完全版
- 如何实现asp.net2.0的SqlCacheDependency
- C#里面比较时间大小三种方法
- 关于ASP.NET2.0编写扩展存储过程的问题
- .net的Membership,为什么就这么困难呢?
- 在Asp.net中调用异步方法-使用信号量
- 打造通用ASP.NET数据分页控件