Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

asp:DropDownList selectedIndexChanged seems to timeout after 20minutes

Posted on 2004-04-27
13
Medium Priority
?
717 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
Independent Software Vendors: 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!

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 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