login page when users session expires within specific period. | ||
Introduction
In every applications, we need to maintain the session expiration time
say for example 1hr or 30 minuets and this configuration item we can do with web.config file or in IIS. But here, application should redirect to login page automatically when session expires. Configure session time
First configure the session timeout value in web.config file as like
below, here I’m configuring the session timeout value as 3 minutes for this sample .
Create Pagebase class
create a custom pagebase class and write the common functionality codes into this class. Through this class, we can share the common functions to other web pages. In this class we need inherit the System.Web.UI.Page class. Place the below code into Pagebase class.e
Above AutoRedirect function will be used to redirect the login page when session expires, by using javascript window.setInterval, This window.setInterval executes a javascript function repeatedly with specific time delay. Here we are configuring the time delay as session timeout value. Once it’s reached the session expiration time then automatically executes the Redirect function and control transfer to login page.
In testAutologout page, we need to inherit the PageBaseclass as like below also same thing we need to inherit wherever required this functionality.
Once application reached session expiration time if suppose there is no action performed by user, it shows the warning message as like below and if clicks the Ok in the message box it redirects to login.aspx page. | ||
What's New in Visual Studio 2017 RC We have many new as well as improved features and experiences in Visual Studio 2017 to make you more productive at things you do every day IntelliSense IntelliSense comes enhanced with added filtering that makes it much easier to use . Filtering makes long lists much more manageable. With features like Camel Case search you only need to type in the 2 letters in capitals for IntelliSense to appropriately filter results for you that match 2 different words with those letters capitalized. IntelliSense is also smarter now; it will select the best matching result from the list instead of simply picking the top result. Navigation Navigation . Navigate To is much more powerful with better filtering and preview. We have also fixed Find All Reference by adding color, grouping, and a peek preview in the Find All Ref window. Live editing One of the most useful features is l...
Comments
Post a Comment