
whats the problem?
123 should be with bild1.gif and second image with bild2.gif

whats the problem?
123 should be with bild1.gif and second image with bild2.gif
took me some time to understand what you were looking for lol bad on my part but i think i have the right solution for you ;) I've gone through and come up with this code, this link helped me to figure out what was going on :)
http://support.microsoft.com/kb/929259
ok i think this should work for you
SPQuery query = new SPQuery(); query.Query = string.Format("<OrderBy><FieldRef Name='Modified' Ascending='FALSE'></FieldRef></OrderBy>"); query.RowLimit = 10; query.IncludeAttachmentUrls = true; SPListItemCollection items = list.GetItems(query); Repeater1.DataSource = items; Repeater1.DataBind(); that is fine and is called after the databound, so its doing the binding and then adding thoes links. To ammend the data whilst its being bound you need to call the itemdatabound event like so:
private List<string> arrayList = new List<string>; protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hp; foreach (SPListItem item in list.Items) { foreach (string currentAttachmentUrl in item.Attachments) { if (!arrayList.Contains(currentAttachmentUrl)) { hp = new HyperLink(); hp.ID = e.Item.ItemIndex.ToString(); hp.Text = item.Attachments.UrlPrefix + currentAttachmentUrl; hp.NavigateUrl = item.Attachments.UrlPrefix + currentAttachmentUrl; arrayList.Add(currentAttachmentUrl); } } } // add to the repeater e.Item.Controls.Add(hp); } } to call the event above you need to add this to the repeater:
<asp:Repeater ID="Repeater1" OnItemDataBound="Repeater1_ItemDataBound" runat="server"> I've taken the code that I've done and added it into the new event, your calling the new event where you create the repeater. This should do the trick :)
EDIT
I've just amended the code above, it checks the current item in the repeater against the current item in the list, if its the same than it will do the code (hyperlink), please let me know the result as you might need to tweak the if function as i dont know what the two values are weather e.Item.ItemIndex starts at 0 or 1 and same with the other :)
hope it helps :)