Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,
I am perform some action in update panel and there is a button to perform that action after perform that action, I want to show a button which is out side of update panel.
Posted
Comments
Ashi0891 14-Aug-14 5:58am    
what have you tried?

1 solution

You can not perform actions on controls outside the updatepanel from controls inside update panel.
You need to put your button(on which action is to be performed) in update panel. Necessarily not in the same panel but in other update panel.
then you can add following code(to hide button in updatepanel2) to make it work:

aspx page

XML
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
       </asp:ToolkitScriptManager>
       <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
           <ContentTemplate>
               <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="GO for it" />
           </ContentTemplate>
       </asp:UpdatePanel>
       <br />
       <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
        <asp:Button ID="Button1" runat="server" Text="Button" />
       </ContentTemplate>
       </asp:UpdatePanel>


code behind:

C#
protected void Button2_Click(object sender, EventArgs e)
    {
        Button1.Visible = false;
        UpdatePanel2.Update();
    }


lemme know if it helps :)
 
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