How to update for this interval

Posted by Jayakumars under ADO.NET on 1/10/2018 | Points: 10 | Views : 335 | Status : [Member] [MVP] | Replies : 1
Hi

How to update for loop for this criteria

in my loop like this

for(int i=1;i<=1000;i++)
{
lable1.text=i.tostring();
}

here i need show this label1.text in every 3 seconds only shows

in my for loop every 3 seconds only update and shows my label like timer and threading i think any one fixed it

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: Sheonarayan on: 1/10/2018 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
for(int i=1;i<=1000;i++)

{
System.Threading.Thread.Sleep(3000);
lable1.text=i.tostring();
}

Write like above.

If it is .aspx page, use setTimeout or setInterval function of JavaScript as explained in this post http://www.dotnetfunda.com/interviews/show/7654/how-to-start-timer-in-javascript . Write label1.text ... in the function in place of alert.


Regards,
Sheo Narayan
http://www.dotnetfunda.com

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response