【问题标题】:Asp.net Search For Special Chars with HttpUtility.HtmlEncodeAsp.net 使用 HttpUtility.HtmlEncode 搜索特殊字符
【发布时间】:2017-10-30 08:18:26
【问题描述】:

我正在使用此代码进行搜索。

Response.Redirect("/Search/" + HttpUtility.HtmlEncode(txtAra.Text));

解码参数
HttpUtility.HtmlDecode(Request.QueryString["tag"]) 

例如,我编写“Ahşap”文本框并重定向。 然后在搜索页面HttpUtility.HtmlDecode(Request.QueryString["tag"])
像“ahÅap”一样返回 我该如何解决这个问题?

【问题讨论】:

  • 你必须做url编码,然后查询字符串会自动解码。 (html 编码不适用于 url)
  • 你能举个例子吗?

标签: c# asp.net search character-encoding urlencode


【解决方案1】:

我用这种方法解决了问题。

Decrypt and Encrypt

【讨论】:

    猜你喜欢
    • 2014-12-31
    • 2015-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-12
    • 2021-10-11
    相关资源
    最近更新 更多