search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Mak the Event a clickable Link

Asked by Allan
9 years ago.

I want to make it so that when the user clicks on an event they are taking to that particular event page. I have tried the following which uses a query strong to pass the ID to the page.

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
BackColor="#FFFFD5" BorderColor="#000000" DataEndField="End"
DataSourceID="SqlDataSource1" DataStartField="Start" DataTextField="Name"
DataValueField="ID" DayFontFamily="Tahoma" DayFontSize="10pt" Days="30"
DurationBarColor="Blue" EventBackColor="#FFFFFF" EventBorderColor="#000000"
EventFontFamily="Tahoma" EventFontSize="8pt" EventHoverColor="#DCDCDC"
HourBorderColor="#EAD098" HourFontFamily="Tahoma" HourFontSize="16pt"
HourHalfBorderColor="#F3E4B1" HourNameBackColor="#ECE9D8"
HourNameBorderColor="#ACA899" HoverColor="#FFED95"
NonBusinessBackColor="#FFF4BC" StartDate="2012-09-01"
EventClickHandling="JavaScript" EventClickJavaScript="clickHandler(e);" />

As you can see there is the clickHandler(e); assigned to the EvenClick via Javascript and the script at the top of the page is.

<script type="text/javascript">
function clickHandler(e) { window.location = 'CourseDetails.aspx?CourseID=' + e.value(); }

However when you click on the event .....nothing happens. Have I done something wrong?
Many thanks for any help.

Comment posted by Allan
9 years ago.

I have just noticed that if I run this page in IE I get an error when I click on one of the links which says 'e' is undefined. I'm not sure what I have done wrong so any help would be appreciated.

Answer posted by Dan Letecky [DayPilot]
9 years ago.


The "e" object is not available in the Lite edition. You should do it like this:

EventClickJavaScript="window.location.href = 'CourseDetails.aspx?CourseID={0}';"

"{0}" will be replaced with the event id.

Comment posted by Allan
9 years ago.

Spot on, that is exactly what I am looking for. Thanks.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.