Код: Выделить всё
String userGroup = GetProfileProperty(SPContext.Current.Web.CurrentUser.LoginName);//get user login's newsgroup // "All";
if (!string.IsNullOrEmpty(userGroup) && !userGroup.Equals("All"))
{
qry.RowLimit = 5;
camlquery = "" + userGroup + "";
qry.Query = camlquery;
items = newsList.GetItems(qry);
//Print items inside a ajax panel....
}
else
{
qry.RowLimit = 5;
camlquery = "";
qry.Query = camlquery;
items = newsList.GetItems(qry);
////Print items inside a ajax panel....
}
Код: Выделить всё
int lastID = items[items.Count - 1].ID;//last news item id of current page
//Get Web Context
SPWeb web = SPContext.Current.Web;
//Clear old panel
UpdatePanel up = (UpdatePanel)FindControl("Panel");
up.ContentTemplateContainer.Controls.Clear();//clear container of old news items
SPQuery qry = new SPQuery();//get query
qry.RowLimit = 5;
string camlquery = "";
qry.Query = camlquery;
SPListItemCollectionPosition position = new SPListItemCollectionPosition("Paged=TRUE&p_ID=" + lastID.ToString());
qry.ListItemCollectionPosition = position;
items = web.Lists["News Wire"].GetItems(qry);// newsList.GetItems(qry);
//print items inside ajax panel....
Подробнее здесь: https://stackoverflow.com/questions/129 ... t-with-c-s