I am using an asp.net/c# datalist.
<
asp:DataList ID="EquipmentList" RepeatColumns="5".....
I have the following line inside the <ItemTemplate
> tag:
<a href=""
><%# {I want to put something here but dont know how} %
> </a
>
In my code behind I have a NameValueCollection variable that contains all strings:
NameValueCollection myListofStrings = //calling a method here that populates myListofStrings
this.EquipmentList.DataSource = myListofStrings;
this.EquipmentList.DataBind();
Please can someone tell me how to bind this NameValueCollection variable to my datalist tag in the markup? Also additional knowledge on how to bind a datalist to a dataset, sqldatareader, IList<> would be helpful. Thannks
thank you all. but for now what do I write inside the tag if lets say i HAVE to bind to a NameValueCollection variable like in my case above. It has no properties or columns so I cannot write anything like Eval("propertyname") which is the answer that most here gave me. It is just like I am binding it to an array of strings. So what do I write now?