I wonder how you could automatically refresh a LABEL
that is in Master Page
. This Label
shows the sum of the amount of the products, and whenever I add a product to the cart Label
does not refresh, just refresh if I refresh the page itself or change pages. Basically I wanted label
to refresh the quantity as soon as the product was added to the cart, not when the page was changed.
Label
is inserted in Form View
within Master
.
<asp:FormView ID="FormViewNE" runat="server" DataSourceID="SqlDataSourceNE">
<ItemTemplate>
<asp:Label ID="lblNE" runat="server" Text='<%# Bind("NE") %>' />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSourceNE" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT SUM (Quantidade) AS NE FROM Carrinho WHERE (IDUtilizador = @IDUtilizador)">
<SelectParameters>
<asp:SessionParameter Name="IDUtilizador" SessionField="IDUtilizador" />
</SelectParameters>
</asp:SqlDataSource>