-1

Suppose, there is asp.net page.This page is divided into three main section. Left side there is navigation menu; right upper top section there is tab;in the right bottom section, actual page content is displaying within iframe. When user click any link from the navigation menu then one tab will be added and corresponding page will open in the iframe just like the tab in the browser in ie/firefox.

Now, the requirement is if user change any input type control like textbox, checkbox and so on ; and after that if user want to close this page by clicking tab, then he will get confirmation to save data.

I have done to display the confirmation message. In the confirmation message, there is two option one is "stay on this page" and another one is "Leave to this page". These two options are default property of browser. I want to detect which one is clicked by user. If user would click the "stay on this page", then tab would not be closed . If user would click "leave to this page", then tab would close.

Kindly guide me if you have any suggestion or solution.

Thanks in advance.

1 Answers1

1

Similar to javascript before leaving the page

 var answer = confirm("Stay or Leave?")
    if (answer){    
        alert("Bye!");
    }
    else{
        alert("Staying!");
    }
Community
  • 1
  • 1
Chris Fremgen
  • 4,649
  • 1
  • 26
  • 26