Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to give two buttons for popup window.i have on button for tht i have given onclientclick event.i want to display Are you sure? message...but it displays only ok button...here i want to display two buttons ok and cancel...when user want to click on cancel button it shd redirects to other page and same for another button.
Posted

in js if you use alert function of js than use instead of confirm function like that:-


C#
function Show1()
        {
            if(confirm('I want ot disply are you sure ?') == true)
             {

// --- write code if user click on ok button  
             }
             else
             {
                 // --- write code if user click on cancel button
             }
        }
 
Share this answer
 
Hi,

Google can save lots of time for issues like you are facing. Solution to your problem is using confirm message box, you can implement like below

C#
var result = confirm('Are you sure you want to leave the page?');
if (result == true)
  // The user wants to continue. Proceed accordingly.
else
  // The user does not want to continue.


For more details see this[^] reference.

You can also considered using
JavaScript
window.onbeforeunload

See this[^] example.
Hope this will help.
 
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