Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Morning to all i want to give conformation alert in browser close button click event i am using the following code


C#
window.onbeforeunload = function () {
                return '';
        }


But the above code Give the alert at all button clickevent so i modified the code as follows


C#
window.onbeforeunload = function () {
            if (Browseraction != "search") {
                return '';
            }
        }

i declare variable Browseraction as a global variable in all bages button click event now the problem is solved.It is worked fine in GoogleChrome,Firefox,Ie7,Ie8, but not work in ie6 how can i solve it ie6 please anyone help me




thanks in advance
By
Meganathan M
Posted

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