protected void amountSearchButton_Click(object sender, EventArgs e) { string billNo = billNoTextBox.Value.Trim(); string mobileNo = mobileNoTextBox.Value.Trim(); if (billNo != "" || mobileNo != "") { BillManager billManager = new BillManager(); Bill bill; if (billNo != String.Empty) { bill = billManager.GetBillByBillNo(billNo); } else { bill = billManager.GetBillByMobileNo(mobileNo); } if (bill == null) { testTypeDangerAlartLabel.Text = "Not Found!!"; testTypeDangerDiv.Visible = true; } else { amountTextBox.Value = bill.Amount.ToString(); dueDateTextBox.Value = bill.Date.Date.ToString("dd/MM/yyyy"); ViewState["BillNo"] = bill.BillNo; } } else { testTypeDangerAlartLabel.Text = "Please enter either Bill No or Mobile No!!"; testTypeDangerDiv.Visible = true; } }