Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
in my web application i have a button click event which calls a procedure which runs for several hours after the procedure is executed i have alabel control to dispaly message,but on dedugging i am able to see the execution of procedure but the label text is not changed ,i use master page with script manager and update panel
 protected void Button_click(object sender, EventArgs e)
 Con.ConnectionString = ConStr;
           if (Con.State == ConnectionState.Closed)
           SqlConnectionStringBuilder build = new SqlConnectionStringBuilder(ConStr);
           string SQLCmd4 = "EXEC DWE_Load_Procedures1 '" + ParamNames + "'";
           SqlCommand cmd = new SqlCommand(SQLCmd4, Con);
// runs sucessfull

lblError.Visible = true;
 lblError.Text = ex.ToString();
///label  not visible on screen

Posted 4-Feb-13 3:10am
Edited 4-Feb-13 3:24am
Krunal Rohit at 4-Feb-13 8:30am
Use try...catch block !!!
JemiM at 4-Feb-13 8:33am
please post your mark up also
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Based on what you say, it sounds like your label is outside the updatepanel that is triggered for a partial update. Make sure that the label is part of the update panel such that on partial re-rendering, label is updated.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It is likely that you are simply timing out long before your procedure completes causing the label not to update.
Are you expecting that the user will keep their browser open for "several hours" waiting for the procedure to finish and then update the label? If so, then you have a severe issue in the architecture of the solution. If you have to trigger the process from a web application, then that is ok, but the response back to the client should only respond whether the procedure was kicked off properly or not. The client should not be required to wait for hours for the process to finish.
My suggestion would be to kick off the procedure and tell the user that the process has begun. Then allow the user to hit the server to check on the process and it's current state, which would be something like "Currently Active", or "Last completed: --run status-- at --date & time--".

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

Advertise | Privacy | Mobile
Web01 | 2.8.150302.1 | Last Updated 4 Feb 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