In this article I would like to share with you a sample program that I wrote using ASP.NET and VB.NET to compute the sum of the two numbers. Actually this is the first time I wrote an ASP.NET application in my entire programming career it is very easy to write one it only takes some dedication and patience to accomplish one. I hope you like my work. 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>Addition of Two Numbers in ASP.NET</title>
</head>
<style>
body
{
background-color:lime;
}
</style>
<body>
<form id="form1" runat="server">
<div>
<b>Addition of Two Numbers in ASP.NET<br />
<br />
Created By Mr. Jake R. Pomperada, MAED-IT</b><br />
</div>
<p>
Enter First Number <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
Enter Second Number
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</p>
<p>
The sum is
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="Sum"
ToolTip="Click here to compute the sum of the two values." Width="75px" />
<asp:Button ID="Button2" runat="server" Text="Clear"
ToolTip="Click here to clear the text box." Width="80px" />
</p>
</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
Me.TextBox3.Text = Val(Me.TextBox1.Text) + Val(Me.TextBox2.Text)
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.TextBox1.Focus()
End Sub
End Class
No comments:
Post a Comment