Archive for April 2008


Data Binding to Key-Value Based Collections in ASP.NET

April 21st, 2008 — 8:03pm

This is as much a note for me as anything as every time I need to data-bind a control to a Hashtable or a Dictionary<TKey, TValue> I always find myself reaching for Google.

When data-binding to a key-value based collection you output data as follows:

  • <%# Eval("Key") %> or
  • <%# Eval("Value") %>

Simple really.

Comment » | asp.net

Back to top