This blog explains the procedure of making an XsltListViewWebPart refresh, automatically. This can be achieved simply by writing a few lines of code given as below:
- SPFile spFile = web.GetFile("Lists/Country/AllItems.aspx");
- SPLimitedWebPartManager wpManager =
- spFile.GetLimitedWebPartManager(PersonalizationScope.Shared);
-
- XsltListViewWebPart lvwp = (XsltListViewWebPart)wpManager.WebParts[0];
-
- lvwp.AutoRefresh = true;
- lvwp.AutoRefreshInterval = 15;
-
- wpManager.SaveChanges(lvwp);