Solved

asp.net display div in updatepanel on click

Posted on 2011-03-17
3
766 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

911 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

19 Experts available now in Live!

Get 1:1 Help Now