Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
We have C# web application ,on button click event we do a data load process using stored procedure which runs for 3 hours,after the procedure finish loading we display a message box using code
 
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), scriptString, true); and turn radiobuttion.SelectedIndex = 2;
 
if the procedure completes in 1 hour things are fine,if it runs for more than 2 hours ,the page turns unresponsive(message box not displayed, radio button not changed),i tried debugged the code, the code process through all lines and completes with no display,can anyone help
Posted 15-Jan-13 23:28pm
Edited 15-Jan-13 23:38pm
ridoy51.2K
v2
Comments
ramnath_k at 16-Jan-13 5:41am
   
yes message box not displayed and radio buttion not changed
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

There is a large fundamental flaw in your application logic at play here. Web applications are really horrible at dealing with long running processes. In this case a 1 to 3 hour wait for response is ridiculous for a web app. When running a long process like this, you should be firing off a worker thread to do this and your notification to the client should be that the process has started. As long as this worker thread is working, your page should just recognize this and tell the user that. When the process completes there should be a more direct notification system in place. Perhaps an email or log entry noting that the process is complete. My personal preference on this is the following:
 
1) User initiates long running process.
2) Server receives the postback and fires off a thread to begin the long running process.
3) Server response is a notification page that the process is currently running.
4) User hits page again.
5) Server receives request and checks if there is already a long running process executing.
a) If the process is running then server response is the notification that the process is currently running.
b) If no, then send the actual page back.
  Permalink  
Comments
ramnath_k at 17-Jan-13 0:50am
   
thank you
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You missed the important lesson during your asp.net web development course.
ScriptManager.RegisterStartupScript
is for 'registering' the javascript method on the page and is NOT for 'calling/executing' a method.
 
Read here...
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.registerstartupscript.aspx[^]
http://msdn.microsoft.com/en-us/library/bb359558.aspx[^]
http://msdn.microsoft.com/en-us/library/bb359558.aspx[^]
 
You need some polling mechanism from your client which checks the status of your 'long running process' and then accordingly shows/hides the message box.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I think this happen because of the request timeout. most probably your web site set request timeout for 1hr.
Because of the timeout response will not getting to the page. (registers script will not rendering)
 
please check the web.config file following section and modify accordingly
 
<system.web>
    <httpruntime executiontimeout="3600">        
</httpruntime></system.web>
 
And please check the following also
 
http://codebetter.com/petervanooijen/2006/06/15/timeout-of-an-asp-net-page/[^]
  Permalink  

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

  Print Answers RSS
0 CHill60 360
1 Sarvesh Kumar Gupta 248
2 OriginalGriff 218
3 Sergey Alexandrovich Kryukov 158
4 RyanDev 120


Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid