//verifying that card number entered is valid
string cardNum = CardNumber.Text.Trim();
long res;
if (long.TryParse(cardNum, out res))
{cardNum = res.ToString();}
else
{strError+="Card Number may only contain numbers";}
//verifying card security code entered is valid
int res3;
string securitycode = CardCode.Text.Trim();
if (int.TryParse(securitycode, out res3))
{
if (res3 > 999)
{strError+="Security Code Value invalid<br/>";}
else
{
securitycode = res3.ToString().PadLeft(3, '0');
}}