Q:

Unable to Retrieve ListBox Item Value ASP.NET

My ListFolder listbox control is returning 0 item. 
I have put in a testLB listbox control for testing and items can be retrieved. 
Below are the code snippets. 
Frontend:
//Returned 0
<div class="tab-content">
    <div id="sectionC" class="tab-pane fade in active">
        <asp:ListBox runat="server" ID="listFolder" CssClass="fileHeight" Style="width: 100%;" SelectionMode="Single" ClientIDMode="Static" onclick="onListFolderClick(); ">
        </asp:ListBox>
    </div>
</div>

//Returned 1
<asp:ListBox ID="testLB" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Single" ClientIDMode="Static">
    <asp:ListItem>item1</asp:ListItem>  
</asp:ListBox>

On Page Load:
//Returned 0
Log.LogDebug("listFolder.Items.Count:" + listFolder.Items.Count, Location);

//Returned 1 
Log.LogDebug("testLB.Items.Count: " + testLB.Items.Count, Location);

Page UI Screenshot:

Headers are selected on the left control All Headers, and added/removed individually to the right control Selected Headers, listFolders lb control. 
Lastly, Generate Report button is clicked and all values in listFolder lb control are to be retrieved.
Do I need to include a container to store the items e.g. <asp:ListItem> to be able to retrieve lb values?
Any help would be appreciated!

A:

Fitst you have to change SelectionMode to Multiple
<asp:ListBox runat="server" ID="listFolder" CssClass="fileHeight" Style="width: 100%;" SelectionMode="Multiple" ClientIDMode="Static" onclick="onListFolderClick(); ">
        </asp:ListBox>

Create javascript method to select all item in listFolder:
function SelectAllItems() {
    $("#listFolder").each(function() { 
        $("#listFolder option").attr("selected", "selected"); 
    }); 

    $("#listFolder").focus();
}

Call SelectAllItems on Generate Report button:
<input type="submit" value="Generate Report" onsubmit="SelectAllItems()" />

