HTTP 404 Error after encoding Url

前端 未结 2 1739
醉梦人生
醉梦人生 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:16

    You shouldn't encode the entire URL, atleast not the 1st "?" symbol. If you encode the ? too then your application looks for a file with the name & extension "UpdateMember.aspx%3fgroupId%3d0032409901" which doesn't exist.

    Probably, this is what you should do.

    http://localhost/UITest/MM/UpdateMember.aspx?groupId%3d0032409901
    

提交回复
热议问题