我正在尝试为多列表框foreach
中的每个所选项目实施UserProfileTrainingSearch
循环:
if (UserProfileTrainingSearch.SelectedValue != "-1" && //other conditions)
{
foreach (var ListBoxItem in UserProfileTrainingSearch.SelectedValue) // only the first item selected is giving the results.
{
Session["UserbyTrainingType"] = "SELECT DISTINCT USERPROFILE.USER_ISN, USERPROFILE.LAST_NAME + ',' ..........................;
SqlUserProfile.SelectCommand = (string)Session["UserbyTrainingType"];
}
}
答案 0 :(得分:0)
foreach (ListBoxItem item in UserProfileTrainingSearch.SelectedItems)
{
// your code here
}