javascript function in Linkbutton not firing in FireFox browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jegathambigai
    New Member
    • Apr 2009
    • 2

    javascript function in Linkbutton not firing in FireFox browser

    when i click the link button in Masterpage the window has to close. This function is working properly in IE but in fireFox or chrome or Safari
    Other than IE in all browsers postback is happening.

    my code :

    <asp:LinkButt on ID="Logout" runat="server" OnClientClick=" closewindow();" >Logout</asp:LinkButton>


    <script>
    function closewindow()
    {
    window.close();
    }
    </script>

    Please help me to solve this issue.

    Thanks in advance

    Regards
    Jegatha.R
  • sanjib65
    New Member
    • Nov 2009
    • 102

    #2
    If you want to prevent the ASP.NET button from causing a postback, then have the Javascript function return false and set your on OnClientClick attribute as follows

    Code:
    <script type="text/javascript">
    function closewindow()
    {
    window.close();
    return false
    }
    </script>
    For further reading please read

    Comment

    Working...