Click here to Skip to main content
15,894,405 members

Comments by Ravinder Kumar Sharma (Top 3 by date)

Ravinder Kumar Sharma 1-Feb-13 2:35am View    
Thanx, I am sending the aspx code as well as under:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="calculator.aspx.cs" Inherits="Calculator_full.calculator" %>

<!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></title>
<link href="Calculator.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.style2
{
margin-left: 4px;
}
.style3
{
margin-left: 0px;
}
.style4
{
background-color: Olive;
font-family: Arial;
font-size: 15px;
font-weight: bold;
color: Black;
}
.style5
{
background-color: red;
font-family: Arial;
font-size: 15px;
font-weight: bold;
color: Black;
}
.style6
{
background-color: Olive;
font-family: Arial;
font-size: 15px;
font-weight: bold;
color: Black;
margin-left: 0px;
}
.style7
{
background-color: gray;
border: solid 2px black;
font-family: Arial;
font-weight: bold;
color: black;
font-size: 16px;
vertical-align: middle;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>

<table align="center" width="35%" style="border-left: 2px solid #00F; border-right: 2px solid #00F;
border-bottom: 2px solid #00F; border-top: 2px solid #00F;">
<tr>
<td colspan="6">
 
</td>
</tr>
<tr>
<td colspan="6" align="center">
<asp:TextBox ID="txt_result" runat="server" Style="text-align: right" Width="93%"
Height="30px" BorderColor="Black" BorderStyle="Groove" CssClass="style3" OnTextChanged="txt_result_TextChanged">
</td>
</tr>
<tr>
<td colspan="6">
 
</td>
</tr>
<tr>
<td colspan="2" width="33.33%" align="center">
<asp:Button ID="btn_clear" runat="server" CssClass="style6" Text="C" BorderColor="Black"
Font-Bold="True" Width="104px" OnClick="btn_clear_Click" />
</td>
<td colspan="2" width="33.33%" align="center">
<asp:Button ID="btn_clearall" runat="server" Text="CE" CssClass="style4" BorderColor="Black"
Font-Bold="True" Width="102px" OnClick="btn_clearall_Click" />
</td>
<td colspan="2" width="33.33%" align="center">
<asp:Button ID="btn_power" runat="server" Text="ON/OFF" CssClass="style5" BorderColor="Black"
Font-Bold="True" Width="108px" OnClick="btn_power_Click" />
</td>
</tr>
<tr>
<%--<td width = "33.33%" class="style1">
<asp:Button ID="btn_clear" runat="server" Text="C" BorderColor="Black" Font-Bold="True"
Width="55px" />
</td>

<td width="33.33%">
<asp:Button ID="btn_clearall" runat="server" Text="CE" BorderColor="Black" Font-Bold="True"
Width="60px" />
Ravinder Kumar Sharma 31-Jan-13 6:26am View    
Thanx but you dont understand dear, for this purpose i already have button for 1 actually i need to replace the value to any digit on click after pressing ON
Ravinder Kumar Sharma 31-Jan-13 6:24am View    
Please read the code carefully and then understand the help that I need.

I want that there is zero in the result textbox when I press ON.
After this I want that now the value that goes in the textbox must replace 0 that we get on pressing ON and on the same button the text is changed i.e. afer pressing ON the text on the same button changes to Off. So, i want clear textbox on pressing OFF, Please help me out.