forrester
-
6/29/2006 7:55:47 PM
[RESOLVED] Re: CMSCalendar control error
I found the problem which stems from a typo in the Developer's Guide > Using Kentico CMS Controls > CMSCalendar
As stated before, I followed the steps in the guide:
##############################
Example
This example will show you how to display a calendar with news items released on particular date.
Create a new Web form.
Drag and drop the CMSCalendar control on the form.
Set the following properties - they specify what should be displayed.
DayField = "NewsReleaseDate" SelectNodesClassName = "cms.news" SelectNodesPath = "/%" SelectNodesPathType = AliasPath
Switch to the HTML mode and add the following code inside the BasicCalendar element. The ItemTemplate section specifies the look of the event that will be displayed in the calendar control. The NoEventsTemplate section specifis the look of the day without any event.
[VB.NET] <ItemTemplate> <br /> <a href='<%# ResolveUrl("~" & Container.DataItem("AliasPath"))%>'> <%# Container.DataItem("NewsTitle")%> <br /> </a> </ItemTemplate> <NoEventsTemplate> <br> No Event </NoEventsTemplate> [C#] <ItemTemplate> <br /> <a href='<%# ResolveUrl("~" & Container.DataItem("AliasPath"))%>'> <%# Container.DataItem("NewsTitle")%> <br /> </a> </ItemTemplate> <NoEventsTemplate> <br> No Event </NoEventsTemplate> #############################
After I looked at it again and compared it with the code on Developer's Guide > Using Kentico CMS Controls > BasicCalendar, I realized the C# code (above) is the same as the VB.NET code on the CMSCalendar example. I changed the syntax accordingly and now it works just fine.
I forgot that the other site that I did was in VB.NET, not C#...which explains why it worked and this one didn't.
forrester
|