Background:
I have a WebPart that makes use of the SPCalendarView control and in it I add items (events) dynamically from different Calendar lists from multiple sites.
like this (please note that I use a bunch of variables I haven't included here):
items.Add(
new SPCalendarItem()
{
ItemID = item["ID"].ToString(),
StartDate = StartTime,
EndDate = EndTime,
hasEndDate = true,
Title = item["Title"].ToString(),
Location = Location,
Description = Description,
IsAllDayEvent = AllDayEvent,
IsRecurrence = Recurrance,
//DisplayFormUrl = ??????????,
CalendarType = Convert.ToInt32(SPCalendarType.Gregorian)
}
);
Problem:
I need to be able to se the DisplayFormUrl dynamically as well:
Currently setting :
DisplayFormUrl = string.Format("/Lists/{0}/DispForm.aspx", LstName)
will use the WebPart's website URL instead of the actual list's url. What I want to be able to do is:
DisplayFormUrl = string.Format("{0}/Lists/{1}/DispForm.aspx", SiteURL,LstName)
Any ideas on how I can achieve this? (if I can)
When I compile it DisplayFormUrl automatically adds the parent web (that the webpart is in) to the URL is there anyway I can change that?
Someone please help...
I want to be able to display items with working links for multiple site like be able to use the urls:
http://site1/lists/...
http://site2/lists/...
If I can make the DisplayFormURL absolute OR Add a link for that particular event, that would be absolutely lovely.
