The ASP Lock ()Method is used to blocks other clients form changing the variable which is stored in the Application Object. This method is used to ensure that only one client at a time can change their application variable at a Time.
Syntax:
Application.Lock
Parameter Value: This method does not contain any value.
Return Value: It has not return any value.
Example: Below code illustrates that the Lock method prevents more than one client at a time from accessing the variable NumVisits.
<%@ Language="VBScript" %>
<%
Application.Lock
Application("NumVisits") = Application("NumVisits") + 1
Application("datLastVisited") = Now()
Application.Unlock
%>
This application page has been visited
<%= Application("NumVisits") %> times!
Last Updated :
10 Sep, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...