Simple counter using ASP.NET and C#?

  • Thread starter Thread starter Pudele J
  • Start date Start date
P

Pudele J

Guest
I a novice at asp and the first time i used it years ago was with vb. Now I am trying to do create a simple counting script using a while loop for some reason its not working. Please help currently i have the following.

int counter = 5;
protected void Page_Load(object sender, EventArgs e)
{
while (counter < 20)
{
counter++;

} Label1.Text = "" + counter + "";
}

}

what i am trying to accomplish is the simple codes we use to write with javascript where you can make counter counts to 20 and you can see the numbers change.
 
Back
Top