Monday 2 June 2014

asp.net 2: square of number

program to make a square of given number.


-----------------------------------------DESIGN-----------------------------------------------------

<%@PageLanguage="VB"AutoEventWireup="false"CodeFile="Default.aspx.vb"Inherits="_Default"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="form1"runat="server">
&nbsp;&nbsp;&nbsp;&nbsp;<h1>square of no</h1><br/>
    Enter No.<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:ButtonID="Button1"runat="server"Text="ok"/>
<br/>
    Ans&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBoxID="TextBox2"runat="server"style="margin-bottom: 9px"></asp:TextBox>
</form>
</body>-
</html>



-----------------------------------------code---------------------------------------------------------

PartialClass _Default
Inherits System.Web.UI.Page
Dim a AsInteger
ProtectedSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles Button1.Click
        a = TextBox1.Text
        TextBox2.Text = a * a
EndSub
EndClass


-----------------------------------------output----------------------------------------------------


umesh sohaliya
codestrew