Click here to Skip to main content
15,912,507 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello To Everyone,

I want to open new window when clicked on link button. The below code works fine in Mozilla firefox(Win XP) but not in Win 7. It gives me error in Internet Explorer on window.open() line. I could not resolve issue. If my code is not proper then let me know the solution that can run in all browser.

XML
<asp:LinkButton ID="TotalRegular_LinkButton"  runat="server" Font-Underline="false"
    OnClientClick="window.open('AllMember.aspx?Index=1','new window','width=950,height=500,scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menubar=no,directories=no');">
    <%# Eval("TotalRegular")%>
</asp:LinkButton>


Thanking You.
Posted
Comments
Sergey Alexandrovich Kryukov 12-Feb-12 13:44pm    
What error? Did you run it under debugger?
--SA
Christian Graus 13-Feb-12 11:57am    
The error means what it says and we don't know how to explain it without knowing the error
Ravindra_Parcha 14-Feb-12 7:28am    
Hi problem solved. In window.open(('AllMember.aspx?Index=1','_blank' ....)

this changes solve my problem

thnx for the attention

1 solution

Try this
XML
<script type="text/javascript">
        function OpenNewWindow()
         {
            window.open("NewWindow.aspx", "List", "scrollbars=no,resizable=no,width=400,height=280");
            return false;
        }
    </script>


<asp:linkbutton runat="server" onclientclick="javascript:NewWindow()" xmlns:asp="#unknown">testLink
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900