Mutiple list item selection from multiple Listbox in asp.net
<p>I have dynamic List boxes in my asp page. and I need to select the items from each list boxes for the below ex. selected item</p>

<pre><code>[Date].[Calendar Date].[Calendar Year].&amp;[2002] from one list box

[Date].[Calendar Date].[Calendar Semester].&amp;[2002]&amp;[2] from another list box

[Date].[Calendar Date].[Calendar Quarter].&amp;[2001]&amp;[4] from another etc....
</code></pre>

<p>I need to bring those above selected items as below</p>

<pre><code>FROM ( SELECT { 
[Date].[Calendar Date].[Calendar Year].&amp;[2002]
} ON COLUMNS 
FROM ( SELECT { 
[Date].[Calendar Date].[Calendar Semester].&amp;[2002]&amp;[2]
} ON COLUMNS 
FROM ( SELECT { 
[Date].[Calendar Date].[Calendar Quarter].&amp;[2001]&amp;[4]
} ON COLUMNS
</code></pre>

<p>below code that i used to do this but no Luck :)</p>

<pre><code>    protected void imgRunReport_Click(object sender, ImageClickEventArgs e)
{
Panel tt = Cache["tt"] as Panel;
string mdxqry;
isRefresh = true;
string Cubename = ddlCubeList.SelectedItem.Value;


Dictionary&lt;string, string&gt; selectedfil = new Dictionary&lt;string, string&gt;();
foreach (ListBox ctl in tt.Controls.OfType&lt;ListBox&gt;())
{
string strSelectedFilters = string.Empty;
selectedfil.Remove(ctl.Text);

foreach (ListItem li in ctl.Items)
{

if (li.Selected)
selectedfil.Add(li.Text, li.Value);

}
strSelectedFilters = "FROM ( SELECT { " + string.Join("," , new List&lt;string&gt;(selectedfil.Values).ToArray()) + "}" + " ON COLUMNS ";



}

}

Remember: these values comes from dynamic listboxes
</code></pre>

<p>thanks In advance</p>
