Wednesday, November 4, 2020

Product of Two Numbers in ASP.NET

 I wrote this simple program using vb.net and asp.net to ask the user to give a number and then the program will compute the product of two numbers and display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price.

My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com





Program Listing


default.aspx

<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"

    CodeBehind="Default.aspx.vb" Inherits="Product_of_Two_Numbers_in_ASP.NET._Default" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

    <style type="text/css">

        .style1

        {

            font-size: medium;

        }

    </style>

</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <h2>

        <strong><b>Product of Two Numbers in ASP.NET</b>

    </strong>

    </h2>

    <p class="style1">

        <strong>Give First Value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

        <asp:TextBox ID="txtvalue1" runat="server" style="font-size: medium"></asp:TextBox>

        </strong>

    </p>

    <p class="style1">

        <strong>Give Second Value&nbsp; &nbsp;&nbsp;&nbsp;

        <asp:TextBox ID="txtvalue2" runat="server" style="font-size: medium"></asp:TextBox>

        </strong>

    </p>

    <p class="style1">

        <asp:Label ID="Label1" runat="server" style="font-weight: 700"></asp:Label>

    </p>

    <p class="style1">

        <asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Size="14pt" 

            Text="Compute" 

            ToolTip="Click here to compute the product oft two numbers." />&nbsp;&nbsp;&nbsp;&nbsp;

        <asp:Button ID="Button2" runat="server" Font-Bold="True" Font-Size="14pt" 

            Text="Clear" ToolTip="Click here to clear the textbox." />

    </p>

    <p class="style1">

        &nbsp;</p>

    </asp:Content>


default.aspx.vb

Public Class _Default
    Inherits System.Web.UI.Page


    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim a, b, product As Integer

        a = Val(txtvalue1.Text)
        b = Val(txtvalue2.Text)

        product = (a * b)

        Label1.Text = "The product of " & a & " and " & b & " is " & product & "."
    End Sub

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

No comments:

Post a Comment