查询字符串中不显示特殊字符 [英] Sqpecial Characters Not Displaying in Query String

查看:172
本文介绍了查询字符串中不显示特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Querystring中传递harsha&Malleswaram





谢谢和问候

Harsha

I need to pass harsha & Malleswaram in Querystring


Thanks and Regards
Harsha

推荐答案

使用URL编码和解码

在c#中使用如下:

string url = HttpUtility.UrlEncode( http://www.abc.com/a?q=b);
use URL Encoding and decoding
In c# use as follow:
string url = HttpUtility.UrlEncode("http://www.abc.com/a?q=b");


使用 Server.UrlEncode

<这是一个例子......

use Server.UrlEncode,

here it is an example...
Dim MyURL As String
MyURL = "http://www.contoso.com/articles.aspx?title=" & Server.UrlEncode("ASP.NET Examples")

Response.Write( "<a href=" & MyURL & "> ASP.NET Examples </a>")



快乐编码!

:)


Happy Coding!
:)


这篇关于查询字符串中不显示特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆