Using getElementById inside user control
- by toraan
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.