open aspx page popup window using javascript

<telerik:RadButton ID="showBtn" runat="server"  Text="Show" onclick="funAddr()" ></telerik:RadButton>



<script type="text/javascript">
        var winRef; //This holds the reference to your page, to see later it is open or not
        function funAddr() {
            var url = '../Admin/DuctorPrescriptionDetails.aspx';
            if (typeof (winRef) == 'undefined' || winRef.closed) {
                //create new, since none is open
                winRef = window.open(url, "_blank", 'location=yes,height=600,width=970,left=300,top=35, scrollbars=yes,status=yes');
            }
            else {
                try {
                    winRef.document; //if this throws an exception then we have no access to the child window - probably domain change so we open a new window
                }
                catch (e) {
                    winRef = window.open(url, "_blank", 'location=yes,height=600,width=970,left=340,top=35, scrollbars=yes,status=yes');
                }

                //IE doesn't allow focus, so I close it and open a new one
                if (navigator.appName == 'Microsoft Internet Explorer') {
                    winRef.close();
                    winRef = window.open(url, "_blank", 'location=yes,height=600,width=970,left=340,top=35, scrollbars=yes,status=yes');
                }
                else {
                    //give it focus for a better user experience
                    winRef.focus();
                }
            }
        }

    </script>

Comments

Popular posts from this blog

FAQ BIND

Create Schema Using C# Asp .Net Dynamically.

resgination mail