javascript - Cant get server control's id using document.getElementById() -


i trying pass asp panel id button onclientclick method , intend show panel document.getelementbyid fetching null value. why not able fetch control's id.

here's mark up:

<asp:panel id="pnl1stdurationwaiverform" style="display: none" runat="server"></asp:panel> <asp:linkbutton id="lbtnyes" runat="server" onclientclick="showdurationwaiver(document.getelementbyid('<%= pnl1stdurationwaiverform.clientid %>'))" text="yes"></asp:linkbutton> 

here's javascript method:

function showdurationwaiver(pnlctrl) {  debugger;  if (pnlctrl != null) {     pnlctrl.style.display = 'block';  }  return false; } 


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -