Generate unqiue Alphanumeric Id

Last Reply on Apr 18, 2012 08:39 AM By Mudassar

Posted on Apr 18, 2012 08:34 AM

i have registration page i want to generate different alphanumeric id with 10 char unique id.

please provide solution.

Posted on Apr 18, 2012 08:39 AM
        string alphanum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
        Random randomNo = new Random();
        string uniqueId = new string(Enumerable.Repeat(alphanum, 10).Select(s => s[randomNo.Next(s.Length)]).ToArray());