Solved

asp.net display div in updatepanel on click

Posted on 2011-03-17
3
771 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 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