ajax panel update during the middle of a function C# ASP.net site

Posted by user2615302 on Stack Overflow See other posts from Stack Overflow or by user2615302
Published on 2013-10-22T17:10:24Z Indexed on 2013/10/23 3:54 UTC
Read the original article Hit count: 114

Filed under:
|
|

ajax panel update during the middle of a function C# ASP.net site

This is the button click. I would like to update LbError.Text to "" before the rest of the function continues. This is my current code.

   protected void BUpload_Click(object sender, EventArgs e)
        {
            LbError.Text = "";

            UpdatePanel1.Update(); //// need it to update here before it moves on 
                                   but it waits till the end to update the lablel
        Exicute functions.....
        .......
        .......
        }





<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<contenttemplate> 
<asp:Label ID="LbError" runat="server" CssClass="failureNotification" Text=""></asp:Label>
<br /><br />
<br /><br />
    <asp:TextBox ID="NewData" runat="server"></asp:TextBox><br />
    then click
    <asp:Button ID="BUpload" runat="server" Text="Upload New Data" 
        onclick="BUpload_Click"/><br />

Things i have tried include have another UpdatePanel just and same results. any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET