?
Solved

asp:DropDownList selectedIndexChanged seems to timeout after 20minutes

Posted on 2004-04-27
13
Medium Priority
?
711 Views
Last Modified: 2012-05-04

Hello,

I have an asp:DropDownList in a user control that appears to be timing out at 20 minutes- even though the web.config is set to 240 (four hours).  The post-back thinks that it is coming to the page for the first time (after twenty idle minutes) and does not trigger the selectedIndexChanged event.  

I am not using EnableSessionState="True" in the Page directive, because this should be the default.

Here is the current form declaration:
<asp:DropDownList  runat="server" CssClass="dropdown45" ID="ddlChangeStates"  TabIndex="-1"></asp:DropDownList>

Any ideas?  I am testing it with AutoPostBack=true and EnableViewState=true next...

Thanks in advance!
0
Comment
Question by:ee_id
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
13 Comments
 

Author Comment

by:ee_id
ID: 10933205
Also worth mention, I am using a base page and template containing the UserControl... here is the Page_Load event of the User Control:

private void Page_Load(object sender, System.EventArgs e)
{
      if ( !this.IsPostBack )
      {
            InitializeControls();
            ddlChangeStates.AutoPostBack = true;
      }
}

Should "this .IsPostBack" be Page.IsPostBack", it appears that the UserControl has an IsPostBack property that may be getting set to false after twenty minutes somehow...

any help would be appreciated
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10933367
Check if you are creating a new session.  Set a breakpoint in the Session_Start method of Global.asax or do some logging there if its on the server. You shouldn't be, but lets eliminate that issue if possible...
0
 

Author Comment

by:ee_id
ID: 10933534

I put a breakpoint on Session_End and it doesn't appear execute... I will try Session_Start
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ee_id
ID: 10933597

Worth noting, it doesn't appear to affect the session objects... just this particular user control doesn't think that the reloaded page is a postback.  
0
 

Author Comment

by:ee_id
ID: 10933724
Neither Session_End nor Session_Start were executed after twenty idle minutes... although, the this.IsPostBack property = false when the selectedIndexChanged event fires- but the event is ignored due to the this.IsPostBack property = false.  The page just refreshes.  

If I try again, then it works... I have to re-awaken the session after twenty minutes of being idel, essentially.
0
 
LVL 12

Accepted Solution

by:
dfiala13 earned 2000 total points
ID: 10934114
Try using a Page.IsPost instead and see what happens.  This is very interesting. Because my first thought was the session was still timing out, but from you said it is not since you are not creating a new session.

Are you caching the control?

Are you using authentication in anyway?
0
 

Author Comment

by:ee_id
ID: 10938785

I am not caching the control, but there is an authentication process... I thought it was in global.asax, but it is not.  What should I be looking at in that regard?

Thx
0
 

Author Comment

by:ee_id
ID: 10938874

Here is my web.config setting:

<sessionState mode="InProc" stateConnectionString="tcpip=000.0.0.0:12345" sqlConnectionString="data source=000.0.0.0;Trusted_Connection=yes" cookieless="false" timeout="240" />
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10939243
What's  your authentication element in the web.config look like?
0
 

Author Comment

by:ee_id
ID: 10939650
<authentication mode="Forms" >
      <forms loginUrl="~/Login.aspx" name=".TESTAPP"/>
</authentication>
<identity impersonate="true" />

<authorization>
      <deny users="?" /> <!-- Allow all users -->
</authorization>
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10939781
Ok,
this could be related to the problem.  The default timeout for Forms authentication is 30 minutes,

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfforms.asp

Change your forms element to...

 <forms loginUrl="~/Login.aspx" name=".TESTAPP" timeout="240" />

Still a strange behavior, since you are not actually denying entry to the app, and all that happens is a new authentication cookie will generated, but might as well eleminate it as an issue.  If you begin to use authentication you will likely want to synch the session and auth timeouts.

0
 

Author Comment

by:ee_id
ID: 10940117

Found the poblem- sorry for any lost time spent on this!  But hope this will help others...

Looks like an authentication cookie was set to twenty minutes and the login.aspx page automatically NT authenticates and redirects back to the original page.  That means the IsPostBack would be false as the page is loading again for the first time, and also explains why the ddl.SelectedIndexChange event does not fire due to the authentication...

Thanks for your input !!!
0
 
LVL 12

Expert Comment

by:dfiala13
ID: 10940207
Glad you got it working!  That's a fun one.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question