Solved

asp:DropDownList selectedIndexChanged seems to timeout after 20minutes

Posted on 2004-04-27
13
692 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
  • 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
 

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 500 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now