I have a foreach loop and need to execute some logic when the last item is chosen from the List, e.g.:
foreach (Item result in Mod
foreach (DataRow drow in ds.Tables[0].Rows)
{
cnt_sl1 = "" +
"
" +
"";
cnt_sl2 = "" +
"" + drow["situation_details"].ToString() + "
" +
"";
if (i == 0)
{
lblSituationName.Text = drow["situation"].ToString();
}
if (drow["images_position"].ToString() == "0")
{
content += "" + cnt_sl1 + cnt_sl2 + "";
cnt_sl1 = "";
cnt_sl2 = "";
}
else if (drow["images_position"].ToString() == "1")
{
content += "" + cnt_sl2 + cnt_sl1 + "";
cnt_sl1 = "";
cnt_sl2 = "";
}
i++;
}