Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to increase expiry timeout to 2-3 hrs in asp .net
Posted
Comments
Thanks7872 28-Jul-14 1:49am    
What do you mean by expiry timeout?
Khan Sameer 28-Jul-14 2:09am    
As i am uploading Photos of the Candidate from the folder to DB there are 7 lakhs photo so after update 1590 records in the DB then Error Msg :
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

 
Share this answer
 
C#
using System;
using System.Web.UI;

public partial class _Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    // Set this ASPX response to expire in one year.
    // ... This is essentially 'never'.
    Response.Cache.SetExpires(DateTime.Now.AddYears(1));
    }
}

Page that uses Response.Cache and Cache-Control: C#

using System;
using System.Web;
using System.Web.UI;

public partial class _Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
	// Set cache for 1 hour on all computers and servers.
	// ... Proxies, browsers, and your server will cache it.
	Response.Cache.SetCacheability(HttpCacheability.Public);
	Response.Cache.SetMaxAge(new TimeSpan(1, 0, 0));
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900