I want to receive notification from database when table is updated but I need a background thread which call after 1 mint and check database table and show me notification. How can I implement a background thread? I have implemented a thread but when I use while(true) in it, my form is not loaded keep on processing.
Code:
protected void Page_Load(object sender, EventArgs e)
{
t1 = new Thread(new ThreadStart(Function1));
t1.IsBackground = true;
t1.Start();
}
private void Function1()
{
while (true)
{
Thread.Sleep(2000);
count++;
Label1.Text = "Function" + count;
}
}