Click here to Skip to main content
15,886,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
 
Share this answer
 

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