Url encodes in asp3

how can i set url encoding in asp3 similar to asp.net code

Public Shared Function UrlEncode ( _
    str As String, _
    e As Encoding _
) As String

How to transfer the type of encoding?

+3
source share
3 answers

Just call UrlEncode and specify the encoding as the second parameter

http://msdn.microsoft.com/en-us/library/h10z5byc.aspx

The same overload is supported in .net 3, so you should be good.

+3
source

Use Server.URLEncode (string) for classic asp.

<% response.write (Server.URLEncode ("http://www.myurl.com?param1=value1¶m2=value2"))%>

+1
source

You can also use UriEncode, but this function is only pressed in javascript, but you can switch the language in asp-classic

<SCRIPT LANGUAGE="JavaScript" RUNAT="Server">
  function fnencodeURIComponent(n)
  {
    return  encodeURIComponent(n)
  }

  function fndecodeURIComponent(n)
  {
    return decodeURIComponent(n)
  }

</SCRIPT>
<% 'normal asp
    url = fnencodeURIComponent(myString)
%>
0
source

All Articles