URL Encode and Decode Demo (VB.net) : URL Encode Decode « Server « ASP.Net

Home
ASP.Net
1.ADO.net Database
2.Ajax
3.Asp Control
4.Collections
5.Components
6.Data Binding
7.Development
8.File Directory
9.HTML Control
10.Language Basics
11.Login Security
12.Mobile Control
13.Network
14.Page
15.Request
16.Response
17.Server
18.Session Cookie
19.Sitemap
20.Theme Style
21.User Control and Master Page
22.Validation by Control
23.Validation by Function
24.WebPart
25.WPF
26.XML
ASP.Net » Server » URL Encode Decode 
URL Encode and Decode Demo (VB.net)

<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub SubmitHTMLEncode_Click(Sender As Object, E As EventArgs)
    Dim MySU as HTTPServerUtility
    MySU = Server
    lblMessage1.Text = "Encoded: " _
        & MySU.HTMLEnCode(txtHTMLEncode.Text"<BR>" _
        "Enter HTML text to encode"
End Sub
Sub SubmitHTMLDecode_Click(Sender As Object, E As EventArgs)
    Dim MySU as HTTPServerUtility
    MySU = Server
    lblMessage2.Text = "Decoded: " _
        & MySU.HTMLDeCode(txtHTMLDecode.Text"<BR>" _
        "Enter HTML text to decode"
End Sub
Sub SubmitURLEncode_Click(Sender As Object, E As EventArgs)
    Dim MySU as HTTPServerUtility
    MySU = Server
    lblMessage3.Text = "Encoded: " _
        & MySU.URLEnCode(txtURLEncode.Text"<BR>" _
        "Enter URL text to encode"
End Sub
Sub SubmitURLDecode_Click(Sender As Object, E As EventArgs)
    Dim MySU as HTTPServerUtility
    MySU = Server
    lblMessage4.Text = "Decoded: " _
        & MySU.URLDeCode(txtURLDecode.Text"<BR>" _
        "Enter URL text to decode"
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Encoding and DeCoding Sample Page</TITLE>
</HEAD>
<BODY TEXT="black" LINK="darkred" VLINK="darkred" ALINK="red" LEFTMARGIN="40" TOPMARGIN="40">
<form runat="server">
<Font Face="Tahoma">
<asp:Label
    id="lblMessage1"
    runat="server"
    Text="Enter HTML text to encode"
    Font-Bold="True"
/>
<asp:TextBox
    id="txtHTMLEncode"
    runat="server"
/>
<BR><BR>
<asp:button 
    id="butEncode"
    runat="server"
    text="Encode"
    Type="Submit"
    OnClick="SubmitHTMLEncode_Click" 
/>
<BR><BR>
<asp:Label
    id="lblMessage2"
    runat="server"
    Text="Enter HTML text to decode"
    Font-Bold="True"
/>
<asp:TextBox
    id="txtHTMLDecode"
    runat="server"
/>
<BR><BR>
<asp:button 
    id="butDecode"
    runat="server"
    text="Decode"
    Type="Submit"
    OnClick="SubmitHTMLDecode_Click" 
/>
<BR><BR>
<asp:Label
    id="lblMessage3"
    runat="server"
    Text="Enter URL text to encode"
    Font-Bold="True"
/>
<asp:TextBox
    id="txtURLEncode"
    runat="server"
/>
<BR><BR>
<asp:button 
    id="butEncode2"
    runat="server"
    text="Encode"
    Type="Submit"
    OnClick="SubmitURLEncode_Click" 
/>
<BR><BR>
<asp:Label
    id="lblMessage4"
    runat="server"
    Text="Enter URL text to decode"
    Font-Bold="True"
/>
<asp:TextBox
    id="txtURLDecode"
    runat="server"
/>
<BR><BR>
<asp:button 
    id="butDecode2"
    runat="server"
    text="Decode"
    Type="Submit"
    OnClick="SubmitURLDecode_Click" 
/>
</Font>
</Form>
</BODY>
</HTML>
           
       
Related examples in the same category
1.Decoding Encoded HTML Strings (VB.net)
2.Encoding URL Strings (VB.net)
3.Encoding URL Strings in VB.net
4.Encoding URL Strings in C#
5.Encoding HTML Strings (VB.net)
6.Server.HtmlEncode (VB.net)
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.