Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shiraj 47 posts 125 karma points
    Aug 13, 2013 @ 11:06
    Shiraj
    0

    innerHTML empty

    Hi,

    In my usercontrol  I am binding a value in to aspnet hyeperlink ike this

             <asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="javascript:void(0);" onclick="PopupCenter(document.getElementById('lbl12').innerHTML, 'myPop1',800,600);">
    

    This code giving me this javascript error

    SCRIPT5007: Unable to get property 'innerHTML' of undefined or null reference

    Cant I use innerHTML like this?

    This is the function

     <script>
             function PopupCenter(pageURL, title, w, h) {
                 var left = (screen.width / 2) - (w / 2);
                 var top = (screen.height / 2) - (h / 2);
                 var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
             }
        </script>
    
    Thanks
  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Aug 14, 2013 @ 10:09
    Dave Woestenborghs
    100

    You will get this error when there is no element with id 'lbl12' on your page.

Please Sign in or register to post replies

Write your reply to:

Draft