<% @ Page Language = "c #" runat = "server" %>
<Script runat = "server">
Void Page_Load ()
{
Pi. Text = Math. PI. ToString ();
Exp. Text = Math. E. ToString ();
}
Void Update (object sender, EventArgs e)
{
Try
{
Double dblInput = Convert. ToDouble (input. Text );
Sqrt_input.Text = dblInput. ToString ();
Sqrt_result.Text = Math. Sqrt (dblInput). ToString ();
Abs_input.Text = dblInput. ToString ();
Abs_result.Text = Math. Abs (dblInput). ToString ();
Log_input.Text = dblInput. ToString ();
Log_result.Text = Math. Log10 (dblInput). ToString ();
} Catch {
Sqrt_result.Text = "";
Abs_result.Text = "";
Log_result.Text = "";
Errormessage. Text = "Error occurred in input ";
}
}
</Script>
<Html>
<Head>
</Head>
<Body>
<Hr/>
Pi = <asp: Label id = "pi" runat = "server"> </asp: Label>
<Br/>
Exponential Constant = <asp: Label id = "exp" runat = "server"> </asp: Label>
<Hr/>
<Form runat = "server">
Input =
<Asp: textbox id = "input" runat = "server"> </asp: textbox>
<Asp: button id = "Button1" onclick = "Update" runat = "server" text = "Submit"> </asp: button>
</Form>
<Hr/>
Square root of <asp: Label id = "sqrt_input" runat = "server"> </asp: Label >=< asp: label id = "sqrt_result" runat = "server"> </asp: Label>
<Br/>
Absolute Value of <asp: Label id = "abs_input" runat = "server"> </asp: Label >=< asp: label id = "abs_result" runat = "server"> </asp: Label>
<Br/>
Logarithm of <asp: Label id = "log_input" runat = "server"> </asp: Label >=< asp: label id = "log_result" runat = "server"> </asp: Label>
<Br/>
<Asp: Label id = "errormessage" runat = "server"> </asp: Label>
<Br/>
</Body>
</Html>