Hi..
Use Sessions to avoid the problem
to bind the data to sessions as Session["DynamicCon"] = mDynamicCon;
and session default time will be 20sec..u can also extend the time.
to retrive the session data as..
mcon = session["DynamicCon"].ToString();
after completion of your task, if u want to exit the respected form..at the time simply close all active sessions per page.
by
Session.Abandon();
Session.RemoveAll();
if (Session["mOrgCode"] == null) { Session.Abandon(); Session.RemoveAll(); Response.Write("<script>window.alert('Your Session has been expired,Please Login again.')</script>"); Response.Redirect("NewLogin.aspx"); } else { mcon = new SqlConnection(Session["DynamicCon"].ToString()); }