js实现C#的Server.Encode和Server.Decode
来源:互联网 发布:淘宝千人千面 刷单 编辑:程序博客网 时间:2024/06/11 17:51
C#中Server.URLEncode和Server.URLDecode是对URL进行编码和解码的方法。
今天,在项目中使用了用户控件,可是由于浏览器认为页面中有js错误,于是按钮的搜索事件无法触发。
于是,想到了使用js。
由于搜索内容可能为中文,而URL中有中文有可能会乱码,得对URL进行编码和解码:
$(function(){ $("#imgSearch").click(function(){ window.location.href="sResult.aspx?keys="+EncodeURI($("#txtSearch").val()); }):});在sResult.aspx页面,可以用:
string text="";try{ text=Request.QueryString["keys"].ToString().Trim();}catch(Exception ex){ text="":}即,URLEncode就和EncodeURI有同样的功能
URIDecode和DecodeURI有同样的功能
- js实现C#的Server.Encode和Server.Decode
- js实现C#的Server.Encode和Server.Decode
- encode和decode的妙用
- python的decode和encode
- python的decode和encode
- python 的encode和decode
- js中encode、decode的应用说明
- C语言实现encode和decode
- js encode decode
- js encode decode
- 实现Server.UrlEncode和Server.UrlDecode功能的js代码
- 客户端的Url encode和decode
- php 和 perl 的json encode decode
- C++语言的url encode 和decode
- 关于URL的encode和decode
- python字符串的decode()和encode()
- python encode和decode的妙用
- python中decode和encode的使用
- linux查看版本信息
- 1483 求最大最小数 九度Online Judge
- 我的第一次面试准备工作
- Struts2.0的优缺点
- Jungle roads (zoj 1406 hdoj 1301)
- js实现C#的Server.Encode和Server.Decode
- Linux Desktop Entry 文件深入解析
- UVA 题目11300 - Spreading the Wealth
- createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);参数
- 优秀C语言开源代码
- 标准DAO的书写原则
- 2013年4月19日--佳都新太笔试题+解答
- 4.20号整理C# DAO.NET
- Linux内核源代码阅读