<%@ Page Language="vb" %> <html> <head> <script runat="server"> Sub Page_Load() Session("foo") = "foo" SyncLock Session.SyncRoot Message.Text = "in lock." End SyncLock End Sub </script> </head> <body> <asp:label id="Message" runat="server"/> </body> </html>