Click here to Skip to main content
11,930,231 members (38,048 online)
Rate this:
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 16-Jan-13 0:28am
Edited 16-Jan-13 0:38am
ramnath_k 16-Jan-13 5:41am
yes message box not displayed and radio buttion not changed
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You missed the important lesson during your web development course.
is for 'registering' the javascript method on the page and is NOT for 'calling/executing' a method.

Read here...[^][^][^]

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.
Rate this: bad
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.
ramnath_k 17-Jan-13 0:50am
thank you
Rate this: bad
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

    <httpruntime executiontimeout="3600">        

And please check the following also[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100