As i really need to finish this task, i have come up with a solution to work around.
What I have done is, i've added a timer and added its tick event as a trigger to updatepanel2. So before i close the div, i set a flag, and enable the timer. In timer, i check the flag, reset it, disable timer again and query the database. Atleast its working.