Click here to Skip to main content
11,806,590 members (40,091 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0 C# web-dev
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 2:10am
Edited 4-Feb-13 2: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)

  Print Answers RSS
0 ppolymorphe 295
1 OriginalGriff 150
2 George Jonsson 135
3 Richard Deeming 120
4 CPallini 100
0 OriginalGriff 3,380
1 Maciej Los 1,990
2 CPallini 1,915
3 KrunalRohit 1,907
4 ppolymorphe 1,317

Advertise | Privacy | Mobile
Web04 | 2.8.151002.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