Wednesday, March 28, 2012

UpdateProgress not reacting to LinkButtons in MultiView and FormView

I have a Content Page with two UpdatePanels. The first one has a FormView inside it and second one has MultiView with several Views. In each of this views I have a GridView in it. I change the views by LinkButtons that are also in the same UpdatePanel.

My problem is that none of the PostBack events in the UpdatePanels seem to fire the UpdateProgress. However, if I add a third UpdatePanel with a Label and a Button whith the following code, it does react to the Button click.

ProtectedSub btnTest_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

System.Threading.Thread.Sleep(3000)

lblTest.Text = DateTime.Now.ToString()

EndSub

But it still won't react to the events in the other two panles. Am I doing something wrong? All help would be greatly appriciated.

Thank you.

One more thing:

I can also move the Label and the Button to one of the exisiting UpdatePanels and the Button Click event does fire the UpdateProgress correcctly.


I also have two DropDownLists in the FromView (located inside a UpdatePanel) with PostBack events. Shouldn't that trigger the UpdateProgess?

Anyone?Tongue Tied

Thank you.


I did some futher testing and noticed if I copy the following in the LinkButton Click Sub, the UpdateProgress shows for that 3 seconds:

System.Threading.Thread.Sleep(3000)

So basically it seems only to work when sleeping but not when doing actually something, like sorting data in the GridView.Huh?

Is there anyway to fire the UpdateProgress manually?


Found an interesting link that almost (but not quite) handels my problem:

http://smarx.com/posts/why-the-updateprogress-wont-display.aspx


I tryed to use UpdatePanelAnimationExtender instead and found out a strage thing. When using the following code clicking the button that does that sleep thing, everything works fine. But when I do any other action on the that UpdatePanel (click a LinkButton that chages the active View, sort data in the GridView) the OnUpdating animation (FadeOut) only begins and then stops for several seconds until the data is rendered and then the OnUpdated animation (FadeIn) runs entirely. Strange!Hmm

<cc1:UpdatePanelAnimationExtenderID="UpdatePanelAnimationExtender1"runat="server"TargetControlID="upnDataTabs">

<Animations>

<OnUpdating>

<FadeOutDuration="1"Fps="40"/>

</OnUpdating>

<OnUpdated>

<FadeInDuration=".5"Fps="20"/>

</OnUpdated>

</Animations>

</cc1:UpdatePanelAnimationExtender>

I seem to be talking to myself here... MUST TAKE MY MEDICAIONIndifferent

No comments:

Post a Comment