views:

44

answers:

2

For the solution, I cannot use any postback methods, because this is all working through ajax. The solution need to be implemented in the asp.net code.

I have a List<WebPage> that contains a list of Links (List<Link>) and I need for all the links to bind repetitive information such as page title, id, url. Here is my current repeater.

<div id="result">
    <asp:Repeater runat="server" id="results">
        <Itemtemplate>
            <asp:Repeater runat="server" datasource='<%# Eval("Links") %>'>
                <Itemtemplate>
                    <tr class="gradeX odd">
                        <td><%# Eval("Id") %></td> //property of WebPage (part of results repeater)
                        <td><%# Eval("Title") %></td> //property of WebPage (part of results repeater)
                        <td><%# Eval("Url") %></td> //property of WebPage (part of results repeater)
                        <td><%# Eval("URL") %></td>//Property of Link
                        <td><%# Eval("URLType") %></td> //Property of Link
                        <td><%# Eval("URLState") %></td> //Property of Link
                    </tr>
                </Itemtemplate>
                </asp:Repeater>
        </Itemtemplate>
    </asp:Repeater>
</div>

of course this doesnt work, how can i do this?

Thanks for your help!

A: 

Not of course actually. I have almost the same, but into inner repeater datasource is set as DataSource='<%# GetLinks(Container.DataItem) %>'
where GetLinks returns casted enumerable of Links

vittore
A: 

Try this:

DataBinder.Eval(((RepeaterItem)Container.Parent.Parent).DataItem, "URL")

The key is to work your way back up to the parent repeater item, and then use the eval method.

Chris Mullins
Thanks man it worked! I'Ve been looking for a solution for this kind of problem for a while, and it was hidden in the databinder class =)
Pierluc