Sitecore 5.0 API

MainUtil.GetNextSequence Method 

Gets next value of the sequencer.

[Visual Basic]
Public Shared Function GetNextSequence() As Long
[C#]
public static long GetNextSequence();

Return Value

The next value of the sequencer.

Remarks

This function is threadsafe and can be used to generate serial numbers. The sequencer is incremented before the value is returned. The value is unique for the duration of the ASP.NET process lifetime.

Example

  string list = "";

  for(int n = 0; n < 5; n++) {
    list += "id" + MainUtil.GetSequencer().ToString() + ",";
  }
  
  // id12,id13,id14,id15,id16

See Also

MainUtil Class | Sitecore Namespace | GetSequencer