I want to display the document library's view on the page. To do so, I am using XsltListViewWebpart.
My code is:
XsltListViewWebPart documentView = new XsltListViewWebPart();
documentView.ListId = documentLibrary.ID;
SPView view = documentLibrary.DefaultView;
documentView.Toolbar = "";
StringBuilder xml = new StringBuilder();
xml.Append("<View Name='" + documentLibrary.DefaultView.ID.ToString("B").ToString().ToUpper(CultureInfo.InvariantCulture) + "' TabularView='FALSE' MobileView='TRUE' Type='HTML' Hidden='TRUE' DisplayName='' Level='1' BaseViewID='1' ContentTypeID='0x' ImageUrl='/_layouts/images/generic.png'>");
xml.Append("<Query><OrderBy><FieldRef Name='ID'/></OrderBy></Query>");
xml.Append("<RowLimit Paged='TRUE'>10</RowLimit>");
xml.Append("<Aggregations Value='Off'/>");
xml.Append("<Toolbar Type='None'/></View>");
documentView.XmlDefinition = xml.ToString();
documentView.AllowClose = true;
documentView.AllowConnect = true;
documentView.AllowEdit = true;
documentView.AllowHide = true;
documentView.AllowMinimize = true;
documentView.AllowZoneChange = true;
documentView.ChromeType = PartChromeType.TitleOnly;
documentView.ID = taskWebPartId;
wpmgr.AddWebPart(documentView, "wpz", 3);
After executing above code web part gets added but the paging is not applied.
To do paging, I have referred this link.
What am I missing?