I want to create an integer sequence in each page request

Here is my code:

```
Public Class Test
    Inherits System.Web.UI.Page

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'integer sequence is created here
        Static Sequence As Int32 = 0
        Sequence = Sequence + 1
    End Sub

End Class

```

My requirements are just created the sequence using VB.NET code and of no database help. The sequence must be started at 1 and incremented by 1. My attempt to solve this is by using STATIC variable within the Page\_Load which can retain the sequence value. But someone told me that my approach is risky because it's not thread safe. Is that true? Or how do I create a sequence for each request that is free from any problems be it thread safe or others?

UPDATE
------

I attempted to solve the problem another way. But I'm not sure the thread safety of my new solution. Here is my code, the call to `Singleton.Instance.Sequence` function will generate a new sequence value:

```
Public NotInheritable Class Singleton
    Private Sub New()
    End Sub

    Public Shared ReadOnly Property Instance() As Singleton
        Get
            Return Nested.instance
        End Get
    End Property

    Private Class Nested
        Shared Sub New()
        End Sub

        Friend Shared ReadOnly instance As New Singleton
    End Class

    Private count As Int32
    Public Function Sequence() As Int32
        count = count + 1
        Return count
    End Function
End Class

```

Does my new solution thread safe? Any alternative solution is welcomed!