Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ASP Lock() Methods

  • Last Updated : 10 Sep, 2020

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.



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!

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!