?
Solved

asp.net display div in updatepanel on click

Posted on 2011-03-17
3
Medium Priority
?
772 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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 …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

771 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