Acces label in footertemplate of gridview in javascript
<p>I have a label in a footertemplate of a gridviewcolumn. I want to put a calculated value (total of the rowvalues) in this label in javascript. I can access all the textboxes in my Itemtemplates, but I don't know how to find my label in my foortertemplates.</p>

<p>.aspx: column in gridview</p>

<pre><code>  &lt;asp:TemplateField HeaderText="Prijs excl. BTW"&gt;
  &lt;ItemTemplate&gt;
    &lt;asp:TextBox ID="txtBTWTarief" Width="60px" runat="server" Text='&lt;%# Eval("exclBTW") %&gt;'   /&gt;
  &lt;/ItemTemplate&gt;
  &lt;FooterTemplate&gt;
    &lt;asp:Label ID="lblTotexclBTW" runat="server" Text="0" Width="60px"&gt;&lt;/asp:Label&gt;
  &lt;/FooterTemplate&gt;
  &lt;/asp:TemplateField&gt;
</code></pre>

<p>.aspx.cs: eventhandlers attached to my textboxes and ddl</p>

<pre><code>protected void gridviewDiversen_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        string evtHandler;
        int rowIndex = Convert.ToInt32(e.Row.DataItemIndex) + 1;
        evtHandler = "updateValue(" + gridviewDiversen.ClientID + "," + rowIndex + ")";
        ((TextBox)e.Row.FindControl("txtBTWTarief")).Attributes.Add("onblur", evtHandler);
        ((TextBox)e.Row.FindControl("txtKorting")).Attributes.Add("onblur", evtHandler);
        ((DropDownList)e.Row.FindControl("ddlBTW")).Attributes.Add("onchange", evtHandler);
    }
}
</code></pre>

<p>javascript: eventhandlers in action</p>

<pre><code>    function updateValue(theGrid, rowIdx)
    {
        var ddl, t1, t2, l1, l2, l3, l4, k1; 
        ddl = document.getElementById(theGrid.rows[rowIdx].cells[2].children[0].id);
        t1 = document.getElementById(theGrid.rows[rowIdx].cells[3].children[0].id); 
        //calculations...
    }
</code></pre>

<p>In this script I find my textboxes in the Itemtemplate, but I don't know how to find my labels in the footer template. Anyone an idea? Thx</p>
