Add selected values to a string
<p>Trying to iterate through ListItems in lstViolations.  Only the first selected value is added to the messagebody and can't figure out why this code won't work </p>

<pre><code>foreach (ListItem item in lstViolations.Items)
{
    if (item.Selected)
    {
        messageBody += item.Value + Environment.NewLine;
    }
}
</code></pre>

<p>By the way, adding messageBody += "test" prints only the first list item followed by test.</p>
