here is my code but it will give me error, Here is my code and below is the erro code
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;
KalaiPosted Feb 17, 2014, 5:41 AM
ex:
lblErr.Text = "please enter amount";
Ali AshiqPosted Feb 17, 2014, 4:54 AM
KalaiPosted Feb 17, 2014, 4:09 AM
double amount = Convert.ToDouble(txtAmount.Text);
double persons = Convert.ToDouble(txtPerson.Text);