I have an ASP.NET UpdatePanel Triggered to refresh based on the Tick event of a Timer.
The page parses a custom XML file and inserts UserControls (containing GridViews) on the fly. This is executed from the Page_Load
method.
if(!Page.IsPostBack)
parseXmlFile();
The first time the page loads, all the controls are displayed as expected. The problem is that the first time the timer Tick
event is fired, all the UserControls disappear.
In the Tick
event I call a custom method RefreshData()
which in turn rebinds the data to the GridView via an SqlDataSource.
public void RefreshData() {
GridView1.DataBind();
...
Maybe I don't understand how AJAX works in ASP.NET.
I only want to parse the XML file once (which creates all the UserControls in the page). From this point I just want to refresh the data contained in the GridView and change the Visibility state of the GridView.