PROGRAM USING LINK BUTTON CONTROL

DEFAULT.ASPX FILE:
<%@ 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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text="User Name:"></asp:Label><asp:TextBox
            ID="TextBox1" runat="server"></asp:TextBox><br />
        <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label><asp:TextBox ID="TextBox2"
            runat="server"></asp:TextBox><br />
        <asp:LinkButton ID="LinkButton1" runat="server" OnClick ="linkButton1_click">Login</asp:LinkButton>
   
    </div>
    </form>
</body>

</html>

DEFAULT.ASPX.VB FILE:


Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub linkButton1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
        Dim a As String = "john"
        Dim b As String = "query"
        If TextBox1.Text = a And TextBox2.Text = b Then
            MsgBox("WELCOME TO MY WEBSITE", MsgBoxStyle.OkOnly)
        Else
            MsgBox("INVALID USERNAME & PASSWORD !!!!", MsgBoxStyle.OkOnly)
        End If
    End Sub

End Class




No comments:

Post a Comment