You are on page 1of 3

<!

DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Calculadora</title>

<style>

.LblPrimero{
position: absolute;
top:20px;
left:30px;
}

.LblSegundo{
position: absolute;
top:65px;
left:30px;

.LblRespuesta{
position: absolute;
top:102px;
left:30px;

.TxtPrimero{
position: absolute;
top:20px;
left:150px;
}

.TxtSegundo{
position: absolute;
top:65px;
left:150px;

.BtnSuma{
position: absolute;
top:20px;
left:370px;
}

.BtnResta{
position: absolute;
top:55px;
left:370px;
}

.BtnMultiplicacion{
position: absolute;
top:90px;
left:370px;
}

.BtnDivision{
position: absolute;
top:125px;
left:370px;
}

</style>

</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Panel ID="Panel1" runat="server" BorderColor="Black"


BorderStyle="Solid" Width="450px" Height="150px">

<asp:Label ID="LblPrimero" runat="server" Text="Primer Numero"


CssClass="LblPrimero"></asp:Label>
<asp:Label ID="LblSegundo" runat="server" Text="Segundo Numero"
CssClass="LblSegundo"></asp:Label>
<asp:Label ID="LblRespuesta" runat="server" Text=""
CssClass="LblRespuesta" Font-Bold="True" Font-Size="XX-Large"></asp:Label>

<asp:TextBox ID="TxtPrimero" runat="server" CssClass="TxtPrimero"


Font-Bold="True"></asp:TextBox>
<asp:TextBox ID="TxtSegundo" runat="server" CssClass="TxtSegundo"
Font-Bold="True"></asp:TextBox>

<asp:Button ID="BtnSuma" runat="server" Text="SUMA" Font-


Bold="True" CssClass="BtnSuma" Width="68px" OnClick="BtnSuma_Click" />
<asp:Button ID="BtnResta" runat="server" Text="Resta" Font-
Bold="True" CssClass="BtnResta" Width="68px" OnClick="BtnResta_Click" />
<asp:Button ID="BtnMultiplicacion" runat="server" Text="Multip"
Font-Bold="True" CssClass="BtnMultiplicacion" Width="68px"
OnClick="BtnMultiplicacion_Click" />
<asp:Button ID="BtnDivision" runat="server" Text="Division" Font-
Bold="True" CssClass="BtnDivision" OnClick="BtnDivision_Click" />

</asp:Panel>

</div>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{

protected void BtnSuma_Click(object sender, EventArgs e)


{

= Double.Parse(TxtPrimero.Text);
= Double.Parse(TxtSegundo.Text);

LblRespuesta.Text = Convert.ToString();

protected void BtnResta_Click(object sender, EventArgs e)


{

= Double.Parse(TxtPrimero.Text);
= Double.Parse(TxtSegundo.Text);

LblRespuesta.Text = Convert.ToString();

protected void BtnMultiplicacion_Click(object sender, EventArgs e)


{

= Double.Parse(TxtPrimero.Text);
= Double.Parse(TxtSegundo.Text);

LblRespuesta.Text = Convert.ToString();

protected void BtnDivision_Click(object sender, EventArgs e)


{

= Double.Parse(TxtPrimero.Text);
= Double.Parse(TxtSegundo.Text);

LblRespuesta.Text = Convert.ToString();

}
}
}

You might also like