here is my code but it will give me error, Here is my code and below is the erro code
C#
protected void btnSearch_Click(object sender, EventArgs e) { if((txtAmount.Text == "") || (txtPerson.Text == "")) { Response.Write("please enter amount"); } else { double amount = int.Parse(txtAmount.Text); double persons = int.Parse(txtPerson.Text); double result = amount / persons; d.Price = Convert.ToInt32(result); d.Select(d); Display(); }
Line 39: else Line 40: { Line 41: double amount = int.Parse(txtAmount.Text); Line 42: double persons = int.Parse(txtPerson.Text); Line 43: double result = amount / persons;
KalaiRank #8,005 · 230 reputationPosted Feb 17, 2014, 12:41 AM EST
ex:
lblErr.Text = "please enter amount";
KalaiRank #8,005 · 230 reputationPosted Feb 16, 2014, 11:09 PM EST
double amount = Convert.ToDouble(txtAmount.Text);
double persons = Convert.ToDouble(txtPerson.Text);
Ali Ashiq61 reputationPosted Feb 16, 2014, 11:54 PM EST