How do I read pagecolumns from the current page
-
06-12-2019 - |
Вопрос
I know that I have to use
SPSite site = new SPSite("SPsite Path");
SPWeb web = site.OpenWeb();
SPList contacts = web.Lists["Listname"];
if I need to get content of a List, but how do I read data from the pagecolumns of the page I am currently on?
Edit:
io=0;
foreach (SPListItem item in SPContext.Current.ListItem.ListItems)
{
output.Write(item[io] + "|" + io + "<br/>");
io++;
}
Does give me: 0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39005A81DBCD88A1A24FA0B25F46F1AEC15500FAC7433996C57149A6320A1777FA6771|0
Решение
SPContext.Current.ListItem["ColumnName"]
should do it
Не связан с sharepoint.stackexchange