Solved

asp:DropDownList selectedIndexChanged seems to timeout after 20minutes

Posted on 2004-04-27
13
695 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short film showing how OnPage and Connectwise integration works.
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

911 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

23 Experts available now in Live!

Get 1:1 Help Now