|
|
Question : Prevent ASP:Timer from causing a page refresh on each on tick EVENT
|
|
This should be simple - I have automated paging for a details view that is taking data from an external rss feed - when I use the asp:time to automatically page through the data, it refreshes the page - how can I prevent this ?
Code
Web form
AutoGenerateRows="False" BorderStyle="None" CaptionAlign="Left" EnablePagingCallbacks="True" GridLines="None" ToolTip="FDA Recall Information - Streaming Live & Up-To-Date" AllowPaging=True>
code behind
protected void Page_Load(object sender, EventArgs e) {
XmlTextReader reader = new XmlTextReader("http://www.fda.gov/oc/po/firmrecalls/rssRecalls.xml"); DataSet ds = new DataSet(); ds.ReadXml(reader); FDADetails.DataSource = ds.Tables[2]; FDADetails.DataBind(); }
protected void Timer1_Tick(object sender, EventArgs e) {
if (FDADetails.PageCount > 0) //Is there more than one page? { if (FDADetails.PageIndex == FDADetails.PageCount) //Is this the last page? { FDADetails.PageIndex = 0; } else { FDADetails.PageIndex = FDADetails.PageIndex + 1; } } }
|
Answer : Prevent ASP:Timer from causing a page refresh on each on tick EVENT
|
|
|
|
|
|
|