I'm following the instructions on:
http://www.telerik.com/help/aspnet-ajax/schedule_howtoexportingtoicalendar.html
to add the export feature to our online calendar already in production. Per the instructions I've added the code block to the .ascx:
And the methods to my codebehind:
the button shows up, however when I click it I get:
"Microsoft JScript runtime error: Object expected" And it highlights the "Export(this, event); return false;" in here:
I'm presuming this is because the Export() method hasn't been written in the .ascx as in the demo on the telerik site, however the instructions I was following do not mention this as necessary.
If this is the necessary code block:
How do I change it to use it without the AjaxManager, I had to remove the AjaxManager to allow the calendar to work inside of sitefinity.
http://www.telerik.com/help/aspnet-ajax/schedule_howtoexportingtoicalendar.html
to add the export feature to our online calendar already in production. Per the instructions I've added the code block to the .ascx:
<div style="text-align: right;"> |
<span style="cursor: pointer; cursor: hand;"> |
<asp:ImageButton runat="server" ID="Button1" ImageUrl="Outlook.gif" AlternateText="Export to iCalendar" |
CommandName="Export" OnClientClick="Export(this, event); return false;" /> |
</span> |
</div> |
And the methods to my codebehind:
private void WriteCalendar(string data) |
{ |
HttpResponse response = Page.Response; |
response.Clear(); |
response.Buffer = true; |
response.ContentType = "text/calendar"; |
response.ContentEncoding = Encoding.UTF8; |
response.Charset = "utf-8"; |
response.AddHeader("Content-Disposition", "attachment;filename=\"RadSchedulerExport.ics\""); |
response.Write(data); |
response.End(); |
} |
protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e) |
{ |
if (e.CommandName == "Export") |
{ |
WriteCalendar(RadScheduler.ExportToICalendar(e.Container.Appointment)); |
} |
} |
the button shows up, however when I click it I get:
"Microsoft JScript runtime error: Object expected" And it highlights the "Export(this, event); return false;" in here:
<input type="image" name="MasterCalendar1$RadScheduler1$ctl138$Button1" id="MasterCalendar1_RadScheduler1_ctl138_Button1" src="Outlook.gif" alt="Export to iCalendar" onclick="Export(this, event); return false;" style="border-width:0px;" /> |
I'm presuming this is because the Export() method hasn't been written in the .ascx as in the demo on the telerik site, however the instructions I was following do not mention this as necessary.
If this is the necessary code block:
<telerik:RadCodeBlock runat="server"> |
<script type="text/javascript"> |
function Export(sender, e) |
{ |
$find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, ""); |
} |
</script> |
</telerik:RadCodeBlock> |
How do I change it to use it without the AjaxManager, I had to remove the AjaxManager to allow the calendar to work inside of sitefinity.