DynamicNavigation.cs
There is a list called DocListNames.Now I shld display the items of the Title field in the form of the table.Actually the items in Title field of MBIADocListNames list are document library names of the site and based upon the Display Indicator field value Yes it has to display the document library names
For this the code is
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
SPSite objsite = SPContext.Current.Site;
SPWeb objweb = SPContext.Current.Web;
SPList objlist = objweb.Lists["DocListNames"];
string camlquery = "
SPQuery query = new SPQuery();
query.Query = camlquery;
SPListItemCollection listItemCollection = objlist.GetItems(query);
if (listItemCollection.Count > 0)
{
writer.Write(" writer.Write(" foreach (SPListItem itmlist in listItemCollection) { string title = (itmlist["Title"]).ToString(); writer.Write(" writer.Write(" "); writer.Write(""); writer.Write(title); writer.Write(""); writer.Write(" "); writer.Write(" } writer.Write(" writer.Write("");
");"); "); "); ");
}
}
No comments:
Post a Comment