<%@ 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>
--%>
|