I am using Thread.sleep(5000) and then using Page.ClientScript.RegisterClientScriptBlock(type, key, script) function to open a new window. I am getting 5 new windows but not in each 5 sec, they all appear together, after 25 sec. Here is my sample code:
for(int i=0;i<5;i++)
{
System.Threading.Thread.Sleep(5000);
string openPage = "<script type='text/javascript' language='javascript'>";
openPage += "window.open('http://www.winpossible.com','mywindow" + i + "','width=600,height=800,toolbar=no,location=Yes,directories=no,status=no,resizable=yes');"; openPage += "</script>";
// Open a new window if there is a new teacher-Student pair comes.
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "sample" + i, openPage);
}
Thanks in advance for your insightful and elegant solutions to this problem! ;o)