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
Daniel
NA
66
0
All paths do not return value help
Jun 22 2007 2:59 PM
Please help. I am getting the error "all paths do not return a value" I can't find it. THANKS IN ADVANCE FOR ANY SUGGESTIONS: HERE'S THE CODE:
private CheckBox FindCheckBox(string sCtrlName)
{
foreach (CheckBox chkTemp in this.Controls)
{
//CheckBox chkTemp = new CheckBox();
//if str is greater than -1, then string was found
if (sCtrlName.IndexOf("YES") > -1)
{
//since YES is selected, find and return
//the "NO" control
int endPos = sCtrlName.IndexOf("_");
string sName = sCtrlName.Substring(0, endPos);
sName += "_NO";
if (chkTemp.Name == sName)
{
//chkTemp = (CheckBox)c;
return chkTemp;
}
}
else
{
//since NO is selected, find and return
//the "YES" control
int endPos = sCtrlName.IndexOf("_");
string sName = sCtrlName.Substring(0, endPos);
sName += "_YES";
if (chkTemp.Name == sName)
{
//chkTemp = (CheckBox)c;
return chkTemp;
}
return chkTemp;
}
}
}
Reply
Answers (
3
)
Interacting with a form on an external website
basic use of arrays