In my previous article I have explained about How to How to Automatically change the version of css and js files in Asp.Net | C#.Net. In this article I am going to explain about how to generate random numbers using C#.Net.
Random class in System namespace is used to generate pseudo-random number within the specified range. For explanation purpose i have a label to show the generated random no and a button to generate the random no.
By default while loading the form itself random no will be generated and shown in the label. And if you click the Generate button then it will generate the random no and show it in the label.
Below is the aspx code
Below is the cs code
Sample output will be
Do you like this article? Help us to improve. Please post your comments below.