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.

No comments:

Post a Comment