Hi!
I've got the same problem as discussed in other threads but I couldn't find an answer in any of them so I'll repost the problem.
Can the UpdatePanel detect session timeout's and redirect the user to the login page? In our current solution the updatepanel will show a dialog box with a cryptic error because the user hasn't got a valid session anymore. We are using forms authentication. This is a big issue for us, so any help would be very appreciated!
- Chris
Hi,Chris
Is it this?
<%@. Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
Guid session_id = Guid.NewGuid();
Session.Add("STATE_SESSIONID",session_id.ToString());
Session.Timeout = 10;
}protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
if (Session.SessionID == null)
{
Response.Redirect("login.aspx");
}
}
</script><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Have you configured your web.config like this
 <forms loginUrl="Login.aspx"
        protection="All"
        timeout="30"
        name=".ASPXAUTH"
        path="/"
        defaultUrl="default.aspx"
         />
Have you solved your problem?
tried anything from post ?
 
No comments:
Post a Comment