HTTP 404 Error after encoding Url

前端 未结 2 1736
醉梦人生
醉梦人生 2021-01-29 04:09

When I use HttpUtility.UrlEncode to encode a Url I end up getting a server error.

ASP.Net code:

NavigateUrl=<%# HttpUtility.UrlEncode(string.Concat(\         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-29 04:13

    HttpUtility.UrlEncode() URL-encodes a string

    That means that it escapes all special characters from the string so that you can insert it as part of a URL without any characters being parsed as URL modifiers.

    You use this kind of escape function when inserting arbitary text as part of a URL.

提交回复
热议问题