Showing posts with label ill. Show all posts
Showing posts with label ill. Show all posts

Saturday, March 24, 2012

UpdatePanel and a listbox

I have an UpdatePanel wrapping a RadioButton control and a ListBox control; depending on which RadioButton is selected, I'll also have either another ListBox control or a TextBox control displayed within the UpdatePanel. All of that works fine. Depending on what the user selects in the first DropDown control, I'm populating another ListBox control outside the UpdatePanel with either Carriers, Members or Providers; that part also works fine, but then I hit a snag. Even though the ListBox outside of the UpdatePanel gets populated, none of the items are displayed unless the entire page is posted back to the server ... something which I'm trying to avoid. Is there any other way to force the ListBox to display those items without performing a postback for the entire page?

I'm reasonably sure that that listbox has to be in an updatepanel to get the behavior you're looking for.


paul.vencill:

I'm reasonably sure that that listbox has to be in an updatepanel to get the behavior you're looking for.

Paul,

I ended up putting the listbox to be populated with either Carriers, Members or Providers into a separate UpdatePanel as you suggested and it works great now. Thanks for the tip! Wink

Allen


Glad I could help

Wednesday, March 21, 2012

Updatepanel and session timeout

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 ?