Click here to Skip to main content
14,641,269 members
Rate this:
Please Sign up or sign in to vote.
Hello Developers,
I've One GridView and In side that Two LinkButton and One Label With One DropDownList and I'm using UpdatePanel and Triggers to restrict Page Load (Refresh Page) on Button Click as you can See Code Belove

So my problem is when I use Triggers it is not a refreshing page That's what I want, but it's not updating the label <pre>lblQtyandRate
as new price and Qty and if I use
PostBackTrigger
it will refresh the page that is I don't want if anyone can Help me

What I have tried:

<pre><asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
         <ContentTemplate>
             <div class="number-left">
                 <asp:LinkButton Text="-" ID="btnRemoveProduct" CommandName="RemoveItem" CommandArgument='<%#Eval("ProductID") %>' runat="server" OnClick="btnRemoveProduct_Click" />
             </div>
         </ContentTemplate>
         <Triggers>
             <asp:AsyncPostBackTrigger ControlID="btnRemoveProduct"/>
         </Triggers>
     </asp:UpdatePanel>


     <div class="number-middle">
         <asp:Label ID="lblQtyAndRate" runat="server" Text="0 / Rs. 0.00"></asp:Label>
     </div>
                                                        
    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional"  >
        <ContentTemplate>
            <div class="number-right">
                <asp:LinkButton Text="+" ID="btnAddProduct" CommandName="AddItem" CommandArgument='<%#Eval("ProductID") %>' runat="server" OnClick="btnAddProduct_Click" />
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnAddProduct"/>
        </Triggers>
 </asp:UpdatePanel>
Posted
Updated 4-Aug-20 23:42pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Only items inside an update panel will change so you'll need to put your label in an existing one or put it in a new one such that it is also updated.
   

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100