Using getElementById inside user control

Posted by toraan on Stack Overflow See other posts from Stack Overflow or by toraan
Published on 2010-03-28T16:22:53Z Indexed on 2010/03/28 16:33 UTC
Read the original article Hit count: 204

Filed under:
|

I have a usercontrol that hides a div when a button is clicked.

<asp:LinkButton ID="lnkbtn" OnClientClick="ShowHide(); return false;" runat="server" />  
<div id="popupPage" style="display:none;">
</div>


 function ShowHideGotoPopUp() {
        var ob = document.getElementById("popupPage");
        if (ob.style.display == "none")
            ob.style.display = "block";
        else ob.style.display = "none"

    }

There is a problem when I place on page more then 1 usercontrol, all controls has div with same id = popupPage.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript