Make updatepanel control visible using javascript

Posted on 2009-04-27
Last Modified: 2012-08-13
Hi, I need to make make updatepanel control visible using javascript, I did something like the following but it does not work:
Question by:Abdu_Allah
    1 Comment
    LVL 3

    Accepted Solution

    If you have set the updatepanel to "UpdatePanel3.visible=false" then you cannot set it in lcient script to visible.  Instead of setting the updatepanel to "UpdatePanel3.visible=false" (ie. make sure "UpdatePanel3.visible=true")  set its style.display to "none" in javascript and then you can use javascript to make it visible.  The attached code shows a basic templatefor this.  Note that the return code for the "panelvisible" function is false as it will stop the form from posting when you click the button to show the panel.
    <asp:UpdatePanel ID="updatepanel3" runat="server" UpdateMode="Conditional" Visible="true">
                <asp:Label ID="lblHello" runat="server">Hello</asp:Label>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:Button ID="Button1" runat="server" Text="Show the update panel" OnClientClick="panelvisible()" />
        <script type="text/javascript">
            var e = document.getElementById("<%= updatepanel3.clientID %>");
   = "none";
            function panelvisible() {
       = "block";

    Open in new window


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    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 …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    732 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

    20 Experts available now in Live!

    Get 1:1 Help Now