Technical support This forum is closed.
Version 1.x > Technical support > Calendar of Events View modes: 
User avatar
Member
Member
kmgillen - 9/9/2006 5:21:32 AM
   
Calendar of Events
I'm new to Kentico, and am really liking it very much. I'm trying to set up a calendar of events for use on my site (I'm building it on my PC using the 30-day demo to make sure Kentico will meet all of my requirements).

I've got the CMSCalendar control showing up properly on my form, however I cannot get it to work properly with the dates when there is an event. I've read through the developers help file, and followed that exactly.

When I add the code to handle the days that have events (see below) i get an error:
_________________________________________________
<ItemTemplate>

<br />

<a href='<%# ResolveUrl("~" & Container.DataItem("AliasPath"))%>'>

<%# Container.DataItem("NewsTitle")%>

<br />

</a>

</ItemTemplate>

<NoEventsTemplate>

<br>

No Event

</NoEventsTemplate>
______________________________________________
Here is the Error Text:
______________________________________________
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30038: Option Strict On prohibits operands of type Object for operator '&'.

Source Error:



Line 28: <br />
Line 29:
Line 30: <a href='<%# ResolveUrl("~" & Container.DataItem("AliasPath"))%>'>
Line 31:
Line 32: <%# Container.DataItem("NewsTitle")%>


Source File: c:\inetpub\wwwroot\KenticoCMS2\calendar.aspx Line: 30
___________________________________________________________
Any suggestions?

Thanks!

User avatar
Guest
admin - 9/11/2006 9:33:31 AM
   
Re: Calendar of Events
Hello,

thank you for your message. If you're using VB.NET, you may need to change the code like this:

<ItemTemplate>
<br />
<a href='<% ResolveUrl("~/." %><%# Container.DataItem("AliasPath"))%>'>
<%# Container.DataItem("NewsTitle")%>
<br />
</a>
</ItemTemplate>
<NoEventsTemplate>
<br>
No Event
</NoEventsTemplate>

Please let me know if it helps.

Best Regards,

User avatar
Member
Member
kmgillen - 9/11/2006 2:25:45 PM
   
Re: Calendar of Events
I copied and pasted your code into place and I got an error (see below):
_____________________________
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30198: ')' expected.

Source Error:



Line 26: <ItemTemplate>
Line 27: <br />
Line 28: <a href='<% ResolveUrl("~/." %><%# Container.DataItem("AliasPath"))%>'>
Line 29: <%# Container.DataItem("NewsTitle")%>
Line 30: <br />

______________________________

Any other suggestions?

Thanks

User avatar
Guest
admin - 9/12/2006 4:11:51 PM
   
Re: Calendar of Events
I'm sorry for the typo. You need to modify the line like this:


<a href='<% ResolveUrl("~/." %><%# Container.DataItem("AliasPath")%>'>

- there's an extra ) character.

Regards,

User avatar
Guest
admin - 9/12/2006 4:12:22 PM
   
Re: Calendar of Events
Sorry, like this:

<a href='<% ResolveUrl("~/.") %><%# Container.DataItem("AliasPath")%>'>

User avatar
Member
Member
kmgillen - 9/25/2006 2:52:22 PM
   
Re: Calendar of Events
Finally got this working. Here's the code that we ened up with to make ti work:
____________________
<ItemTemplate>
<br />
<a href='<% ResolveUrl("~/.") %><%# Container.DataItem("AliasPath")%>.aspx'>
<%# Container.DataItem("Title")%>
<br />
</a>
</ItemTemplate>
____________________

One more question on this. I would like to use the mini calendar in the corner of a page. I don't need (or want) it to display the event title in the calendar. I'd like for it to simply turn the day on the calendar into a link, that when clicked on, it will take you to a page that will show all of the events on that day. Obviously, I'll need to build my transformation for that, but how would I structure the <ItemTemplate> section to handle this?

Thanks for your help.

User avatar
Guest
admin - 9/25/2006 6:18:48 PM
   
Re: Calendar of Events
Hello,

you need to use an empty transformation only and set the DayWithEventsStyle
property to the style you want to use.

Best Regards,

User avatar
Member
Member
kmgillen - 9/25/2006 9:40:45 PM
   
Re: Calendar of Events
Peter,

Thanks for the feedback. Using the CMSCalendar control, there is no DayWithEventsStyle for me to modify. The only things available are DayHeaderStyle, DayStyle, NextPrevStyle, OtherMonthDayStyle, SelectedDayStyle, SelectorStyle, TitleStyle, TodayDayStyle, WeekendDayStyle.

What am I missing?

User avatar
Guest
admin - 9/26/2006 9:00:44 PM
   
Re: Calendar of Events
Hello,

you need to do this in the code behind, in the Page_Load method. Here's an example:

Dim style As TableItemStyle = New TableItemStyle
style.BackColor = Color.Blue
CMSCalendar1.DayWithEventsStyle = style

Best Regards,

User avatar
Certified Developer v7
Certified  Developer v7
bedardv - 1/29/2008 6:52:43 PM
   
RE:Re: Calendar of Events
This, set the backcolor of the date but the date is not linked, how i can do that please.