Capturing the mouse's idle state within a Master Page iFrame using JavaScript

Currently, I have a website set up with a Master page that displays various other pages from different folders in an IFrame within the master page. My goal is to implement a feature where if the user remains inactive on any of these pages for a certain period of time (let's say 5 minutes), they will receive an alert message prompting them to either continue or log out. How can I accomplish this?

Answer №1

Take, for instance, using the setTimout function in JavaScript when hovering over an iFrame. With each hover event, clear the timeout using clearTimeout and set a new one.

However, I believe handling session timeouts on the server is a more reliable approach. More information on session states can be found here: ASP.NET Session State

When a session ends, the user may be automatically logged out and prompted to login again the next time any action requires a post request to the server.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Can Single File Vue Components be integrated into pre-existing HTML files?

As I work on developing a Flask project, my goal is to incorporate Vue.js. Although I've researched methods for using js files and integrating them into my html files to create components, I am curious about the possibility of directly creating vue fi ...

IIS log records displaying Modified URLs instead of their Original counterparts

Recently, I have encountered an issue where changing the method of Url Rewriting in my Asp.Net application has resulted in a transformation of the IIS log files. Previously, they appeared like this: /page/ 80 etc.. /page/anotherpage/ 80 etc... Now, they ...

What is the most efficient way to update several documents at once by referencing the value of a nested property?

Looking to update documents based on nested property values? Let's take an example document: { "_id": "61e3050a465c380aec9f56a1", "name": "John Doe", "status": "pending", ...

Using Prototype Library to Implement the Nth-child Selector

I've been experimenting with using "nth-child(n)" in Prototype, similar to how it's done in jQuery. See the example code below... function myFunction() { $$('div.amfinder-horizontal td:nth-child(1) select').simulate('click'); ...

Ways to access the content of the chosen <td> element using Vue?

I have a dynamic table where I retrieve data using $.ajax() from a database. The content in the rows is editable, and I need to save the changes made with vue.js. After updating the content, an $.ajax() function with 4 parameters (name, client_id, url, and ...

Utilize JQuery's ajax .load() method to correctly link to the specific URL

I currently have a local server with multiple projects, and for this specific project in VS2010 properties->web->use local IIS web server = 'localhost/project4/'. (I'm unable to utilize the regular debug VS Development Server due to ce ...

Preserving KendoGrid Selection Status During Navigation Between Pages

When using kendoGrid, I encounter an issue where the selected product ID does not persist across different pages. Initially, when the grid is loaded, the corresponding row is selected based on the productID. However, after unchecking the product ID on the ...

Is there a method to directly download large files from the server without having to wait for the blob response?

I'm currently working on video file requests using axios. I have set the requests with responseType: blob to create a video player once the response is received with window.URL.createObjectUrl(). However, I also have a button that allows the user to d ...

Strange ASP.NET Redirection/Submission Problem

My code is enclosed in a try/catch block with a redirect to another page, but I'm encountering a problem. When a user clicks on a submit button, instead of redirecting to the intended page, the page simply refreshes and stays on the same page. This is ...

Acquire information from a Card using Oracle Apex

I have a Card Regions that showcases some of my tables. I'd like each card to redirect to a specific page based on a number (the "page_table" number corresponds to the page it will redirect to). Below is the Query for the Cards Region: SELECT table_n ...

Top tips for data manipulation

I am facing an issue with my JavaScript code that makes an ajax request to the server and receives JSON data, which is not correctly formatted for array-based manipulation. A colleague suggested a client-side solution to convert object-based JSON into arra ...

Implementing Observable in a function is a simple and effective way to

According to luwojtaszek answer in this topic: How to Export JSON to CSV or Excel - Angular 2 I tried out the following code: public exportAsExcelFile(json: any[], excelFileName: string): void { const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_s ...

The React router Link appears to be updating the URL, but is failing to properly redirect the user

While utilizing react-router, everything seems to be functioning properly. However, when I attempt to change the :id in the URL, the page does not redirect as expected. <Route path="/school/:id" component={School}/> For example, if I am currently ...

Utilizing JavaScript to verify the presence of a div element within dynamically injected HTML code

While working on a website, I have implemented an embed function which involves calling a javascript from my server to inject HTML on another remote server. To ensure that these embeds also benefit from Google ranking, I have included a piece of HTML in t ...

Utilizing express and socket.io for seamless cross-domain communication

Is there a way to activate cross-domain functionality for express.io? I require it for a Cordova application, but when using Chrome, I get an error message saying "No 'Access-Control-Allow-Origin' header is present on the requested resource. Orig ...

Unexpected HashLocationStrategy Issue in Angular 2 (ECMAScript 5)

Currently, I am trying to implement Hashlocationstartergy for routing in angular2 using ES5. Below is the code snippet I have used to bootstrap main.js: (function(app) { document.addEventListener('DOMContentLoaded', function() { ng. ...

Measuring code coverage for aspx, aspx.cs, ascx, and ascx.cs files

My project employs a combination of aspx, aspx.cs, ascx, and ascx.cs files. I am interested in conducting code coverage for all of these files, however, I currently do not have any unit tests in place. Can code coverage be accomplished without existing uni ...

Efficient approach for presenting clients with a functional demonstration

Without sparking a debate, this post isn't about professional advancement but rather the business perspective: If a company opts to utilize ASP.Net MVC as its primary method for constructing websites and applications. However, it's worth noting t ...

The paging functionality in ASP.net Core 3.1 Razor pages is experiencing issues when used with a dapper dataset

I'm a newcomer to asp.net core and I'm attempting to utilize the pager control LazZiya.TagHelpers in an ASP.net core 3.1 Razor Page project for paging to display new items. However, it seems to be showing all 20 news items on the news page despit ...

Using jQuery to Save Data Locally in a JSON File

Just a heads up; all of my work is kept local. I've been on the hunt for ways to write to a JSON file from a JS script using jQuery. Many methods involve PHP, but I don't have much experience with that language and would prefer to avoid it for no ...