Here is the complete solution,
1. You have to set the session timeout in web.config
2. In page load, add the code below
3. Add the client side cod to popup the alert
protected void Page_Load(object sender, EventArgs e)
{
int SessionTimeout = Session.Timeout;
StringBuilder d = new StringBuilder();
d.Append("<script language='javascript'>\n");
d.Append("function BeforeTimeout()\n{\n");
d.Append("setTimeout('CheckSession()',60000*" + ")\n}\n");
d.Append("\n");
d.Append("function CheckSession()\n{\n");
d.Append("doLogout();\n}");
d.Append("window.onload=BeforeTimeout; \n");
d.Append("</script>\n");
Page.ClientScript.RegisterStartupScript(typeof(Page), "key1", d.ToString());
}
client side
function doLogout(){
}
Hope this helps.
cheers