Saturday, September 30, 2017

Palindrome Checker in ASP.NET

Here is a simple program that I wrote that will ask the user to give a string and then our program will check if the given string is a Palindrome or Not a Palindrome using VB.NET as my programming language and ASP.NET as my web development SDK framework. I hope you will find my work useful. Thank you.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.







Sample Program Output


Program Listing

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Palindrome Checker in ASP.NET</title>
</head>
<style type="text/css">
    p 
 {
  font-family:Arial;
  font-size:16px;
  color:Blue;
  font-weight:bold;
        width: 672px;
    }

 body 
 {
  font-family:Arial;
  font-size:14px;
  color:Blue;
  font-weight:bold;
  background-color:Lime;
  }

</style>

<body>
    <form id="form1" runat="server">
    <br />
    <p align="center">
        Palindrome Checker in ASP.NET <br /><br/>
        Created By Mr. Jake R. Pomperada, MAED-IT
        </p>
    <p align="center">
        &nbsp;</p>
<p align="left">
        Give a String&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server" Width="193px"></asp:TextBox>
        </p>
<asp:Button ID="Button1" runat="server" Text="Check" align="center" 
        ToolTip="Click here to check if the given string is a palindrome."/>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button2" runat="server" Text="Clear" align="center" 
        ToolTip="Click here to clear the textbox."/>
    <br />
    <br />
    <br />
    <br />
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>


Default.aspx.vb

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim s1 As String
        Dim s2 As String

        Me.Label1.Visible = True

        s1 = Me.TextBox1.Text.ToLower
        s2 = StrReverse(s1)
        If (s1 = s2) Then
            Me.Label1.Text = "The given string  " + s1.ToUpper() + " is a Palindrome."
        Else
            Me.Label1.Text = "The given string " + s1.ToUpper() + " is Not a Palindrome."
        End If
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Label1.Visible = False
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Label1.Text = ""
        Me.TextBox1.Text = ""
        Me.TextBox1.Focus()
    End Sub
End Class



No comments:

Post a Comment