Solved

asp:DropDownList selectedIndexChanged seems to timeout after 20minutes

Posted on 2004-04-27
13
697 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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
 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get id from json Data with NewtonSoft 3 49
Angular JS Route 3 68
Simple Injector with Web Service 4 38
Service Controller 1 23
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

9 Experts available now in Live!

Get 1:1 Help Now