How do you use an Ampersand in an HTTPCookie in VB.NET?

后端 未结 3 1050
挽巷
挽巷 2021-01-27 01:14

I have a cookie saved to the user as follows...

Dim searchCookie As HttpCookie = New HttpCookie(\"SearchCriteria\")
searchCookie.Item(\"SearchText\") = FullSearc         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-27 01:36

    The cookie values need to be encoded. I'm no VB expert, but it looks like this is done with the method

    System.Web.HttpUtility.UrlEncode
    

提交回复
热议问题