bool accountFlag = false; string message = ""; //i just added this variable ... lblAcctMsg.Text = "Missing Information"; if (this.txtAccountName.Text == "") { message = " - AccountName"; lblAcctMsg.Text += message; //" - AccountName"; lblAccountnameErr.Visible = true; accountFlag = true; } else { message = ""; lblAccountnameErr.Visible = false; lblAcctMsg.Text = "" + message; } //primary account id textbox if (this.txtPrimaryAct.Text == "") { lblAcctMsg.Text += " - Primary AccountName"; lblPrimaryAccountIDError.Visible = true; accountFlag = true; } else { lblPrimaryAccountIDError.Visible = false; lblAcctMsg.Text = ""; } try { double d = Convert.ToDouble(txtVolatility.Text); if (this.txtVolatility.Text == "") { lblAcctMsg.Text = " - Volatility"; lblVolatilityError.Visible = true; accountFlag = true; } else { lblVolatilityError.Visible = false; lblAcctMsg.Text = ""; } } catch { lblAcctMsg.Text = " - Volatility"; lblVolatilityError.Visible = true; accountFlag = true; } if (accountFlag) return;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)