TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rubi Begum
NA
7
5.7k
Error in validating textbox
Jun 14 2012 3:10 AM
For Validating the MinLengthTest for a textbox i used the following coding their is an error showing :"THE NAME 'txtMinLengthTest ' does not exist in the current context.Please resolve my problem where i need to initialize this 'txtMinLengthTest '
Thanks in Advance.
private void txtMinLengthTest_Validated(object sender, EventArgs e)
{
bool bTest = txtMinLengthTestIsValid();
if (bTest == true)
{
this.errorProvider1.SetError(txtMinLengthTest, "The field must contain a minimum of 7 characters");
}
else
{
this.errorProvider1.SetError(txtMinLengthTest, " ");
}
}
// Test to see that the textbox contains a minimum number of characters
private bool txtMinLengthTestIsValid()
{
char[] testArr = txtMinLengthTest.Text.ToCharArray();
bool testBool = false;
if (testArr.Length < 7)
{
testBool = true;
}
return testBool;
}
}
Reply
Answers (
5
)
Book details
help regarding radiobutton