Ejemplo n.º 1
0
    protected void btnDivide_Click(object sender, EventArgs e)
    {
        string a = txtOperand1.Text;
        string b = txtOperand2.Text;
        int    x = Int32.Parse(b);

        if (x == 0)
        {
            lblResult.Text = "Denominator cannot be zero";
        }
        else
        {
            txtResult.Text   = c.Divide(a, b);
            txtOperand1.Text = "";
            txtOperand2.Text = "";
        }
    }
Ejemplo n.º 2
0
    protected void btnDiv_Click(object sender, EventArgs e)
    {
        string a = txtOperand1.Text;
        string b = txtOperand2.Text;
        int    x = Int32.Parse(b);

        if (x == 0)
        {
            lblMessage.ForeColor = System.Drawing.Color.Red;
            lblMessage.Text      = "Denominator cannot be zero";
        }
        else
        {
            txtResult.Text   = c.Divide(a, b);
            txtOperand1.Text = "";
            txtOperand2.Text = "";
        }
    }