Sunday, January 12, 2014

ASP.NET code to calculate the number of days a person has lived on basis of the Date of Birth



ASP.NET code to calculate the number of days a person has lived on basis of the Date of  Birth
<%@ 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>
   
        ENTER YOUR NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server" Width="204px"></asp:TextBox>
        <br />
        ENTER YOUR BIRTHDATE&nbsp;
        <asp:TextBox ID="TextBox2" runat="server" Width="204px"></asp:TextBox>
        <br />
        <asp:Button ID="Button1" runat="server" Text="CALCULATE" Width="245px" />
        <br />
        <br />
   
    </div>
    </form>
<p><%  Response.Write("hi " & un & "<br>")
       Response.Write("your birthdate is  " & bd & "<br>")
       Response.Write("Todays  date  is " & Today() & "<br>")
       Response.Write("you have lived on this beautiful earth for precious " & diff & "  days")
       %></p>

</body>
</html>

1 comment: