Adalat  Khan

Adalat Khan

  • 655
  • 1.5k
  • 865.7k

How to handle the Close event in MVC Core Application

Jul 10 2019 3:14 AM
I have an application in MVC Core. I want the follwing two things:
 
1. When i run my Application i want to disable the Browser Back, and Forward buttons so no user can click the Back or Forward button but the user should use only the main menu of the Application.
 
2. I want to handle the application Close or Exit event. When a user close the application using the Browser Cross (X) button then i want to store some log off information.
 
Please help me in above two points. If Point number 1 is not good or not a professional way please give me some alternate way. I want point number 1 because when a user log in to the application and when that user press the browser Back button then the log in form again show and the current user session information do not store in the database. So i want to disable the browser Back button or if a user press the Back button then the application should log off.   

Answers (1)