Make updatepanel control visible using javascript

Hi, I need to make make updatepanel control visible using javascript, I did something like the following but it does not work:
Who is Participating?
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.