Showing posts with label second. Show all posts
Showing posts with label second. Show all posts

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

Monday, March 26, 2012

Updating gridview without postback

Hi!

I want to refresh a gridview without doing postback every second and for do it I use a System.Timer.

I have the grid into an updatepanel and I want to know how can I make, from the elapsed event of the timer, to refresh the grid.

I am trying to use theICallbackEventHandlerbut I can't reach my target.

Could anyone said me if I can do it and how could I do?

I have search code samples but they aren't useful for me.

Try this:

Put a button on the form somewhere, set the onclick event to trigger an update of the gridview. Check that pressing this button updates the gridview as expected.

Make this button invisible by using style='Display:none;'.

On the timer elapsed event add a call to myButton.Click();

Andy.


Finally I have used the Anthem.net library and its panel component. It was very easy working with it doing the refresh without the postback.

There is more information inhttp://www.codeproject.com/Ajax/AnthemNET.asp.