Encoding URL Strings (VB.net) : URL Encode Decode « Server « ASP.Net






Encoding URL Strings (VB.net)

<%@ Page Language="VB" %>
<html>
<head>
   <title>Encoding URL Strings</title>
   <script runat="server">

      Sub UrlEncode()

         Dim StrToEncode As String
         Dim StrToReturn As String

         StrToEncode = "Hello, World!"
         StrToReturn = Server.UrlEncode(StrToEncode)
         Response.Write("<a href=""UrlDecode.aspx?StrToDecode=" & _
            StrToReturn & """>" & StrToReturn & " - Click to Decode!</a>")

      End Sub

   </script>
</head>
<body>

<% UrlEncode %>

</body>
</html>


<%-- UrlDecode.aspx
<%@ Page Language="VB" %>
<html>
<head>
   <title>Decoding Encoded URL Strings</title>
   <script runat="server">

      Sub UrlDecode()

         Dim StrToDecode As String
         Dim StrToReturn As String

         StrToDecode = Request.QueryString("StrToDecode")
         StrToReturn = Server.UrlDecode(StrToDecode)
         Response.Write(StrToReturn)

      End Sub

   </script>
</head>
<body>

<% UrlDecode %>

</body>
</html>


--%>
           
       








Related examples in the same category

1.Decoding Encoded HTML Strings (VB.net)
2.Encoding URL Strings in VB.net
3.Encoding URL Strings in C#
4.Encoding HTML Strings (VB.net)
5.Server.HtmlEncode (VB.net)
6.URL Encode and Decode Demo (VB.net)