if you know for sure that textbox40.Text is a numeric value then it would probably help to post the code for check.PostalCodeChecking() to see what's going on inside that method. But you really should create an int variable and set it to the value of TextBox40 and then pass that variable into the method. It provides for better error checking. Also, do you really have 40 TextBoxes labeled as TextBox1, TextBox2, etc? If so you should really look into naming your controls with meaningful names, something that gives a hint of what the control is being used for. It makes debugging and maintaining your applications a lot simpler.
Cherryhomesj
Junior Poster in Training
58 posts since Sep 2011
Reputation Points: 30
Solved Threads: 17
Try this,
int num;
int.TryParse(TextBox40.Text,out num);
if(check.PostalCodeChecking(DropDownList2.SelectedItem.Text,num)==false)
{
Label2.Visible = true;
}
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241