Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

Update pannel is working for only one Button

Here is my code pls help me out to clear dis issue

I need the button pannel to work for all my three buttons

ASP.NET
 <div class="form-group">
   <asp:UpdatePanel ID="up" runat="server" UpdateMode="Always">
    <ContentTemplate>
 <div class="col-lg-offset-2 col-lg-10">
  <table>
  <tr>
 <td>
  <asp:Button ID="btnSearch1" OnClick="btnSearch1_Click" runat="server" Text="Search" class="btn btn-successfrm" />
 </td>
  <td>
 <asp:Button ID="btnClear1" Text="Clear" runat="server" CssClass="btn btn-default" OnClick="btnClear1_Click" />
</td>
 <td>
 <asp:Button ID="btnExportToExcel1" runat="server" Text="Export to Excel" CssClass="btn btn-warning" OnClick="btnExportToExcel1_Click" />
 </td>
 </tr>
</table>
 <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
<ContentTemplate>
 <asp:GridView ID="gvManageSo1" runat="server" AutoGenerateColumns="False" DataKeyNames="mstsalesorder_id"
  </asp:GridView>
 </ContentTemplate>
  <Triggers>
  <asp:AsyncPostBackTrigger ControlID="gvManageSo1" />
</Triggers>
 </asp:UpdatePanel>
   </ContentTemplate>
  <Triggers>
 <asp:AsyncPostBackTrigger ControlID="btnSearch1" />
  <asp:AsyncPostBackTrigger ControlID="btnClear1" />
  <asp:AsyncPostBackTrigger ControlID="btnExportToExcel1" />
</Triggers>
</asp:UpdatePanel>


pls help me to clear this issue
Posted

1 solution

Just updated:
XML
<asp:ScriptManager ID="abc" runat="server"></asp:ScriptManager>
<div class="form-group">
    <div class="col-lg-offset-2 col-lg-10">
        <table>
            <tr>
                <td>
                    <asp:Button ID="btnSearch1" runat="server" Text="Search" class="btn btn-successfrm" OnClick="btnSearch1_Click" />
                </td>
                <td>
                    <asp:Button ID="btnClear1" Text="Clear" runat="server" CssClass="btn btn-default" OnClick="btnClear1_Click" />
                </td>
                <td>
                    <asp:Button ID="btnExportToExcel1" runat="server" Text="Export to Excel" CssClass="btn btn-warning" OnClick="btnExportToExcel1_Click" />
                </td>
            </tr>
        </table>
        <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="gvManageSo1" runat="server" AutoGenerateColumns="False" DataKeyNames="mstsalesorder_id">
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSearch1" />
                <asp:AsyncPostBackTrigger ControlID="btnClear1" />
                <asp:AsyncPostBackTrigger ControlID="btnExportToExcel1" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</div>
 
Share this answer
 
v3
Comments
usha C 14-Aug-14 1:03am    
If i put outside of the content panel my page is get post back...

So no use of including update panel
Trung Nguyen Son 14-Aug-14 1:57am    
AsyncPostBackTrigger: "Defines a control and optional event of the control as an asynchronous postback control trigger that causes the UpdatePanel control to refresh."

Just do it, you'll see!
usha C 14-Aug-14 2:21am    
Still Facing the same issue...

At !st time its work and at the next time when i click the button the grid is not updating

And none of the action was performed

Its not Refreshed...
Trung Nguyen Son 14-Aug-14 2:27am    
1. REMOVE <asp:AsyncPostBackTrigger ControlID="gvManageSo1" /> in UpdatePanel4
2. PUT
<asp:AsyncPostBackTrigger ControlID="btnSearch1" />
<asp:AsyncPostBackTrigger ControlID="btnClear1" />
<asp:AsyncPostBackTrigger ControlID="btnExportToExcel1" />
in the UpdatePanel4
3. And REMOVE updatepanel "up"
usha C 14-Aug-14 2:43am    
Still the Prob remains same..

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