Solved

asp.net display div in updatepanel on click

Posted on 2011-03-17
3
765 Views
Last Modified: 2012-05-11
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
Comment
Question by:doramail05
  • 2
3 Comments
 
LVL 9

Expert Comment

by:gery128
ID: 35155632
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
 
LVL 1

Accepted Solution

by:
doramail05 earned 0 total points
ID: 35248285
solved with this >

<asp:updatepanel id="udp01" runat="server" >
<asp:Panel id="panel01" runat="server" />
...
0
 
LVL 1

Author Closing Comment

by:doramail05
ID: 35308502
solved already
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now