Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
Validate the course name in repeater control in Asp.net
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
narasiman rao
10y
599
1
Reply
In Repeater Control as follows
CourseName CourseDate Amount
RAFF 29 Jun 14 500
RFPFF 30 Jun 14 600
Submit (Button)
In the above repeater control i want to validate RPST course must be there in the repeater control.
if RPST course is not there in the repeater control i want to show the message "RPST course must be there".
In the above repeater control RAFF and RFPFF course is there. But RPST course is not there in repeater control.
When user clicks the Submit Button i want to validate RPST course must be there.
For that i written a code as follows
if (rptCart1.Items.ToString().Trim() != "RAFF")
{
Label23.Text = "RAFF Course must be there";
}
else if (rptCart1.Items.ToString().Trim() != "RFPFF")
{
Label23.Text = "RFPFF course must be there";
}
else if (rptCart1.Items.ToString().Trim() != "RPST")
{
Label23.Text = "RPST Course must be there";
}
In repeater control both the courses RAFF and RFPFF course is there. Only RPST course is not there.
But when i click the submit button message shows "RAFF Course must be there".
But in the repeater control RAFF course is there. RPST course only is not there.
from my above code what is the mistake i made.please help me.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Evaluate a string expression
Contact ID alarm system in C#.NET with VoIP