Asp.net page getting expired - "internet explorer cannot dispaly a message"
-
Hi, I have developed one webpage, in which it read data from database and process each record with some logic and the final output is set to excel file. If the table contains more than 100 thousand records, my aspx page get expired. But backend the process is done. How to avoid the expiration of page. I reasearch some part and used below code. but no use. private int timeOut; private void Page_Init(object sender, System.EventArgs e) { timeOut = Server.ScriptTimeout; // Give it 1 hour = 3600 seconds Server.ScriptTimeout = 72000; } private void Page_Unload(object sender, System.EventArgs e) { Server.ScriptTimeout = timeOut; }
G. Satish
-
Hi, I have developed one webpage, in which it read data from database and process each record with some logic and the final output is set to excel file. If the table contains more than 100 thousand records, my aspx page get expired. But backend the process is done. How to avoid the expiration of page. I reasearch some part and used below code. but no use. private int timeOut; private void Page_Init(object sender, System.EventArgs e) { timeOut = Server.ScriptTimeout; // Give it 1 hour = 3600 seconds Server.ScriptTimeout = 72000; } private void Page_Unload(object sender, System.EventArgs e) { Server.ScriptTimeout = timeOut; }
G. Satish
If the process takes long enough that your page expires the first thing I'd look at is re-architecting the solution rather that trying to work around the issue. From a UI perspective you should have some feedback for the use if there is a long running process. You could possibly use an AJAX call to refresh a progress bar.
only two letters away from being an asset
-
Hi, I have developed one webpage, in which it read data from database and process each record with some logic and the final output is set to excel file. If the table contains more than 100 thousand records, my aspx page get expired. But backend the process is done. How to avoid the expiration of page. I reasearch some part and used below code. but no use. private int timeOut; private void Page_Init(object sender, System.EventArgs e) { timeOut = Server.ScriptTimeout; // Give it 1 hour = 3600 seconds Server.ScriptTimeout = 72000; } private void Page_Unload(object sender, System.EventArgs e) { Server.ScriptTimeout = timeOut; }
G. Satish
IIS would recycle the worker process after the specified timeout period. As suggested by the other member, you may like to review your architecture towards lessening (or rather balancing) the load. There are tweaks like extending the runtime attributes in web.config/machine.config which might apply for your application only after a careful study of the same and its genuine need.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep! -
Hi, I have developed one webpage, in which it read data from database and process each record with some logic and the final output is set to excel file. If the table contains more than 100 thousand records, my aspx page get expired. But backend the process is done. How to avoid the expiration of page. I reasearch some part and used below code. but no use. private int timeOut; private void Page_Init(object sender, System.EventArgs e) { timeOut = Server.ScriptTimeout; // Give it 1 hour = 3600 seconds Server.ScriptTimeout = 72000; } private void Page_Unload(object sender, System.EventArgs e) { Server.ScriptTimeout = timeOut; }
G. Satish
the way you are doing currently is almost impossible and senseless to keep page alive for so long. However you can make an asynchronous call to a function which will do all the required processing and after successful completion will sent back confirmation through ws_callback method. then you can show the "successfully done" message to confirm that processing has been done. You can google for asynchronous calls
Regards, Kapil Thakur (Where's there is Kapil , there is a way) - thakur.kapil@gmail.com