Generating Random Numbers in Asp.Net using C#

In this ASP.NET tutorial I will show you how to generate random numbers in asp.net using c#

Just copy/paste the following code in the .aspx.cs page and enjoy the random numbers

yourpage.aspx.cs

Random RandomClass = new Random();

int RandomNumber = RandomClass.Next(4, 14);

TextBox1.Text = Convert.ToString(RandomNumber);

// RandomClass.Next(4, 14) means you will get any random number between/ within this range.

So this is the way we can get random numbers in asp.net using c#

0 comments: