Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Asp.net Web application i have a problem to Retrieve Gridview footer value.

I want to retrieve grid view footer text. that footer contain net amount ,this net amount changing Dynamically,
if retrieving the footer value only get older value not get new changed value .

My code is
XML
<asp:TemplateField HeaderText="Amount" >
                                       <ItemTemplate>
                                           <asp:Label ID="lblAmount" runat="server"  Text='<%# Eval("Amount") %>'></asp:Label>
                                       </ItemTemplate>

                                           <FooterTemplate>
                                               <asp:Label ID="lblTotal" runat="server" ></asp:Label>
                                           </FooterTemplate>

                                   </asp:TemplateField>

Label lblTotal = ((Label)gvDetail.FooterRow.FindControl("lblTotal"));
        NetAmount= Convert.ToDecimal(lblTotal.Text);

script portion to change footer text
NetAmount = parseFloat(NetAmount) + parseFloat(Total);

C#
var ctrlNetAmount = "ContentPlaceHolder1_gvDetail_lblTotal";
                    document.getElementById(ctrlNetAmount).innerHTML = NetAmount;


After changing the footer by script igot thet value in footer an currectly display it. but when retrieve only get the older text of lblTotal,ie older value

pls help me
Posted
Updated 5-Sep-11 2:01am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900