conditional UpdatePanel doesn’t work

I have the following simple code:

 

"UpdatePanel2" runat="server" UpdateMode="Conditional">

    "Label3" runat="server" Text="Label">
    "Button2" runat="server" Text="Button" onclick="Button2_Click">



code behind:

    protected void Button2_Click(object sender, EventArgs e)
    {
        Label3.Text = "waiting...";
        UpdatePanel2.Update();
        Thread.Sleep(5000);
        Label3.Text = "done";
        UpdatePanel2.Update();
    }

But it doesn't update the panel until the end. i.e. you don't get to see the "waiting…" text (in fact, you don't see it at all) and then a 5 second pause, then "done". Why doesn't this work? I followed the video and couldn't find a mistake.

 Thanks,
Yoni

Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s