Label refresh auto

Asked

Viewed 125 times

1

I wonder how I could automatically refresh a LABEL who is in a Master Page. That one Label shows the sum of the quantity of the products, and whenever I add a product to the cart Label does not refresh, just refresh if I refresh from the page itself or if I change page. Basically wanted the label made the quantity refresh, so the product was added to the cart, not when it changes page.

To Label is embedded in a Form View within the 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>

1 answer

0

Try replacing your 3rd line of code with this:

<asp:Label ID="lblNE" runat="server" Text="<%= Bind("NE") %>" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.