Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 776
  • Last Modified:

asp.net display div in updatepanel on click

trying to display div in updatepanel once the button 'btnDisplay' is clicked. Close after another click.
<asp:UpdatePanel ID="udp01" runat="server">
            <ContentTemplate>
                <div id="div01" runat="server">
                    <asp:Label ID="lbl01" Text="abc" runat="server" />
                
                </div>
            
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnDisplay" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>

        <asp:Button ID="btnDisplay" OnClick="btnDisplay_Click" runat="server" />

Open in new window

0
doramail05
Asked:
doramail05
  • 2
1 Solution
 
gery128Commented:
Are you fetching data from database or doing any server side processing on Button Display's click?

You can use javascript for this, Update Panel will degrade the performance and not recommended for such kind of operations.

In javascript you can simply do this:
document.getElementById('myDiv').style.display = 'block';   //To Show
document.getElementById('myDiv').style.display = 'none';   //To Hide

This script can be called on client click of server button.

0
 
doramail05Author Commented:
solved with this >

<asp:updatepanel id="udp01" runat="server" >
<asp:Panel id="panel01" runat="server" />
...
0
 
doramail05Author Commented:
solved already
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now