In my project, I want to get all content of a SPListItem which is a calendar event. However, I have no idea to get them.
using (SPSite site = new SPSite(@"http://spabc/"))
using (SPWeb web = site.OpenWeb())
{
SPList cal = web.Lists["Calendar"];
SPListItemCollection items = cal.Items;
string texts = string.Empty;
foreach (SPListItem item in items)
{
var xml = item.Xml;
texts += xml;
}
lab.Text = "Event: " + texts;// it shows "Event: "
}
Target:
Title, start Time, End Time, All Day Event, and Recurrence..
example of recurrence:
Recurrence: Every 1 month(s) on the first Tuesday