i have a shopping cart website and i have a track your order function wherein the admin can type in a "number" and transaction details will be viewed. however, i am trying to break my program and tried to input letters(abc) inside the transaction text box. it showed me an error that the input string was not in the correct format. should i use char? string? any references and answers are highly appreciated. :)
here is my code on the button in my transaction text box.
protected void btnGo_Click(object sender, EventArgs e)
{
if (txtTransactionNo.Text != string.Empty)
{
rblOrderDetails.Visible = true;
ShowOrderDetails(rblOrderDetails.SelectedValue, Convert.ToInt32(txtTransactionNo.Text));
}
else
{
rblOrderDetails.Visible = false;
Panel1.Visible = false;
Panel2.Visible = false;
Panel3.Visible = false;
}
}
and here where i declared the transactionNO text box
public string TransactionNoText
{
get { return txtTransactionNo.Text; }
set { txtTransactionNo.Text = value; }
}