I'm a total noob to .NET, ASP.NET, LINQ and so on, so please be gentle. :-)
I'm trying to display a list of people and the tags that are on those people, something like this:
Gabriel - this, that, these, those
John - that, those, another
Sarah - that, another, something
I'm using Linq to access the data, and can get the list of people going with this code:
1 var peoplelist = from p in thing.People
2 select new {
3 p.FullName
4 };
5
6 PeopleRepeater.DataSource = peoplelist;
7 PeopleRepeater.DataBind();
Now, I have a m->m link between people and tags, and use code like this to display the tags on a single person:
1 var taglist = (from tag in db.Tags
2 join persontag in db.PeopleTags on tag.id equals persontag.TagID
3 where persontag.PersonID == person.PersonID
4 orderby tag.TagName
5 select tag);
6
7 ViewTagRepeater.DataSource = taglist;
8 ViewTagRepeater.DataBind();
I can't for the life of me figure out how to get these to play nicely together using nested repeaters. If I move the ViewTagRepeater into the PeopleRepeater.ItemTemplate, and adjust the query to relate to peoplelist somehow, will everything just kind of work together?
Thanks!