Nested repeaters - accessing a control inside the parent repeater from the child repeater
<p>I have a page where I list several hotels, and for each hotel I list the prices for each date that the user selected.</p>

<p>My HTML looks like this:</p>

<pre><code>&lt;table&gt;
&lt;asp:Repeater ID="rptrHotels" runat="server"&gt;
    &lt;ItemTemplate&gt;
        &lt;tr&gt;&lt;td&gt;&lt;%# Eval("HotelName") %&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;
            &lt;asp:Repeater ID="rptrHotelRates" runat="server" DataSource='&lt;%# GetHotelRates(Container.DataItem) %&gt;'&gt;
                &lt;ItemTemplate&gt;
                    &lt;td&gt;
                        &lt;span class="date"&gt;&lt;%# Eval("Date") %&gt;&lt;/span&gt;
                        &lt;span class="price"&gt;$&lt;%# Eval("Price") %&gt;&lt;/span&gt;
                    &lt;/td&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:Repeater&gt;
            &lt;td&gt;
                &lt;span class="date"&gt;Total&lt;/span&gt;
                &lt;span class="price"&gt;$&lt;asp:Literal ID="litTotal" runat="server" /&gt;&lt;/span&gt;
            &lt;/td&gt;
        &lt;/tr&gt;                   
    &lt;/ItemTemplate&gt;
&lt;/asp:Repeater&gt;
&lt;/table&gt;
</code></pre>

<p>And my code-behind:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        DateTime startDate = Request.QueryString["StartDate"];
        DateTime endDate = Request.QueryString["EndDate"];

        List&lt;Hotel&gt; hotels = GetHotels(startDate, endDate);
        rptrHotels.DataSource = hotels;
        rptrHotels.DataBind();
    }
}


protected List&lt;Rate&gt; GetHotelRates(object item)
{
    DateTime startDate = Request.QueryString["StartDate"];
    DateTime endDate = Request.QueryString["EndDate"];
    Hotel hotel = (Hotel)item;

    List&lt;Rate&gt; rates = GetRates(hotel, startDate, endDate);

    decimal total = (from r in rates
                     select r.Price).Sum();

    return rates;
}
</code></pre>

<p>In my GetHotelRates() function, I'm getting the total price by summing up all the rate prices. But I need to somehow put that value in litTotal, which is outside the child repeater, but inside the parent repeater.</p>

<p>How can I do that?</p>
