.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

User Being Asked To Log In Again After Approx 20 Minutes

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :ASP.Net

Dear All

I have a web application that uses forms authentication, memberships and roles. I'm finding it difficult to test but it looks as though the application is forcing my users to log in again after about 20 minutes of inactivity. However, the nature of my application requires users to stay logged in for longer than this even if they aren't using the application constantly.

I've already set the following line in my web.config file so that doesn't seem to be making a difference:

<sessionState timeout="60"/>

Is there something else that I need to set to prevent my users from being redirected to the login page too early on? I'd like them to be inactive for about an hour before forceably logging them off. I don't want them to lose their work if they don't use the system for 20 minutes.

Please can you help me?

Many thanks



View Complete Post

More Related Resource Links

User complaining about getting kicked out repeatedly after only a few minutes...


Hi, I am using forms authentication.  My web.config file contains this:

<authentication mode="Forms">
 <forms loginUrl="Login.aspx" defaultUrl="LeaseTracker.aspx" protection="All"   timeout="30" slidingExpiration="true"/>
 <deny users="?"/>

And the login includes this:

FormsAuthenticationTicket formsAuthenticationTicket =
 new FormsAuthenticationTicket(1, userName, DateTime.Now, DateTime.Now.AddMinutes(30),
 _isPersistent, userData, FormsAuthentication.FormsCookiePath);


Response.Redirect(FormsAuthentication.GetRedirectUrl(userName, _isPersistent));

Any ideas on why it would be treating the user this way?

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

How to track the changes of user contacts(colleagues) by using SharePoint API

We might have seen colleague tracker web part which keep tracks the changes made in our contacts/colleagues details like profile/lists/sites. The same tracking mechanism can be implemented by using MOSS API in any custom web part/ web control/ feature/web service...

UserProfile.GetColleagueChanges is the method which returns all changes happened with the contacts, this method also accepts a Query (UserProfileChangeQuery) where we can specify different parameters to filter the changes

Configuring User Profiles in SharePoint Server 2010

Note: I've added the necessary links relating to SharePoint Server 2010 prerequisites, along with instructions for configuring the user profile synchronization service, at the end of this

User Defined Functions in Microsoft SQL Server

User Defined Functions are compact pieces of Transact SQL code, which can accept parameters, and return either a value, or a table. They are saved as individual work units, and are created using standard SQL commands. Data transformation and reference value retrieval are common uses for functions. LEFT, the built in function for getting the left part of a string, and GETDATE, used for obtaining the current date and time, are two examples of function use. User Defined Functions enable the developer or DBA to create functions of their own, and save them inside SQL Server.

Frequently Asked Questions - SQL Server Data Types

This is good and precise introduction and Frequently Asked Questions - SQL Server Data Types

Building Re-Usable ASP.NET User Control and Page Libraries with VS 2008


I am having problems with a user control. I want my solution to have a separate project for holding my user controls.

The main project can get a reference to this user control project and can import this user control dll into my main project. 

Thanks in advance,

Dheeraj Mittal


Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


How to let user edit selected gridview columns, not entire row



I've got a gridview I would like to let the user edit a couple of columns.  Seems like everything I'm coming across so far makes the entire row editable.  

Hopefully the solution isn't too complicated.  Can someone point me in the right direction?


how to get an array of all the asp.net textbox control inside create user wizard control?



How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

<script type="text/javascript">
        function addLoadEvent(func) {
            var oldonload = window.onload;
            if (typeof window.onload != 'function') {
                window.onload = func;
            } else {
                window.onload = function() {

        function prepareInputsForHints() {
            var inputs = document.getElementsByTagName("asp:TextBox");
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onfocus = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                inputs[i].onblur = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";



<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

UI Datepicker and web user controls



I have developed an application using the Master-Detail pattern described in this Matt Berseth article.

The only difference between Matt's article and me is that I am using a FormView object in place of a DetailsView.

Everything works fine except that the formview object, in my case it's inside a user control and I can't figure out how to use the jquery datepicker UI plugin.

I have tried to put the script block for the datepicker either in the aspx page as well as inside the user control but in both cases the calendar does not come up when the related textbox get the focus.

Any suggestion on how to work with the datepicker inside an ascx?

thanks in advance!

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

Error when updating. Supposedly updating ID without being asked.



Server Error in '/' Application.

Value of member 'ID' of an object of type 'Ref' changed.
A member defining the identity of the object cannot be changed.
Consider adding a new object with new identity and deleting the existing one instead.

I get this error whenever I attempt to update an entry. Even an entry that has had nothing altered. I have tried to circumvent it but I think it must be a simple oversight. How could I have caused an ID update using the Edit.aspx page of dynamic data? Thank you in advance for the help!

Linq - add data to database then email user the details


Hi all

I'm not sure how to structure the code for this but what I want to do is be able to add data to a database, and once this has completed successfully, then email the user to say the details have been added successfully to the database.

I need to:

1. Check that the relevant data has been added into the database then

2. Email the details of the relevant data when completed. 


Thanks in advance for your help,




logged in user data


I'm using the defualt membership provider, i created a table and used the gridview on the logged in user page to show his information such as address e-mail phone zip code etc,, how can i do this without writing a code?

I am new to asp.net  i need simple help please?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend