[Solved] how to perform addition using a textbox [closed]


@user3174595 : I have put in the simple code. its the easiest operation that can be performed.

form1.aspx

<body>
<form id="form1" runat="server">
<div>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><br />
    <asp:Label ID="Label1" runat="server" Text="0" ></asp:Label>
</div>
</form>

form1.aspx.cs

public partial class addition : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        double userValue = 0;
        if (double.TryParse(TextBox1.Text,out userValue))
        {
            Label1.Text = (double.Parse(Label1.Text) + userValue).ToString();
        }
    }
}

1

solved how to perform addition using a textbox [closed]