如何在查询字符串中传递带单引号的变量 [英] how to pass variable with single quotes in querystring
本文介绍了如何在查询字符串中传递带单引号的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要编码才能在查询字符串中传递带单引号的变量...
任何人都可以帮助我.
I need a coding to pass variable with single quotes in querystring...
Can anyone plz help me.
推荐答案
您需要对其进行编码.
放入%27
You need to Encode it.
Put%27
HttpUtility.UrlEncode("'"); //Equivalent of it ' (%27)
你好
在传递参数之前,先做
Hi
Before passing teh parameter do
Response.Redirect(test.aspx?a=Server.URLEncode("amit'a") + "&b=" + Server.URLEncode("ss'a"))
Then on the recepient page do
Server.URLDecode to get the parameters
祝你好运
快乐编码:)
Best Luck
Happy Coding:)
这篇关于如何在查询字符串中传递带单引号的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文