fetch dictionary from arraylist

and277

New Member
\[code\]protected Dictionary<string , string> xmlList = new Dictionary<string , string>();protected System.Collections.ArrayList list = new System.Collections.ArrayList();\[/code\]I have stored the dictionary in an arraylist like this..\[code\] xmlList.Add( "image" , "images/piece1.png" ); xmlList.Add( "description" , " Experience why entertainment is more amazing with Xbox." ); xmlList.Add( "title" , "Downloads" ); list.Add( xmlList ); xmlList.Clear(); xmlList.Add( "image" , "images/piece2.png" ); xmlList.Add( "description" , "Limited-time offer: Buy Office now, get the next version free.*" ); xmlList.Add( "title" , "Security & Updates" ); list.Add( xmlList );\[/code\]How can I access each element of the dictionary from the arraylist?\[code\]<% for (int i = 0; i < list.Count; i++) { foreach(Dictionary<string , string> itemList in list) { Response.Write( itemList["image"] ); } } %>\[/code\]and that gives me the same result 'images/piece2.png' two times..I couldn't do \[code\]foreach(Dictionary<string , string> itemList in list) { Response.Write( itemList["image"] ); }\[/code\]
 
Back
Top