I am generating a random number and i want it to be posted on a label during pageload, im not quite sure, how to get it up there.
At some point i want to check the number against a database as well, to make sure its not in there, and if it is find another that isnt, but thats in the future for now.
here is my code.
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
label1.Text = Foo.value ((ToString)) ;
}
protected void Button1_Click(object sender, EventArgs e)
{
}
class Foo
{
public static int GetNextValue()
{
const int minValue = 1;
const int maxValue = 999999;
Random random = new Random(DateTime.Now.Millisecond); // Initialize for better distribution
int value;
do
{
val ...
Go to the complete details ...