Hello,
I'm updating the startdate of a daypilot calendar using an anthem calendar.
Everything is working untill I use a DropDownList in the same page: the refreshCallBack event is never received on the server side.
Is there a better way to update the startpage property using a callback ?
my code (remove 'dlUserName.Items.Add(new ListItem("erez", "fes"));' and it is working):
<%@ Page Language="C#" MasterPageFile="~/Sample.master" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<%@ Register TagPrefix="anthem" Namespace="Anthem" Assembly="Anthem" %>
<script runat="server">
protected void DayPilotCalendar1_Refresh(object sender, DayPilot.Web.Ui.Events.RefreshEventArgs e)
{
DayPilotCalendar1.StartDate = Convert.ToDateTime(Session["ldt"]); // e.StartDate;
DayPilotCalendar1.DataBind();
DayPilotCalendar1.Update();
}
protected void cal_SelectionChanged(object sender, EventArgs e)
{
Session["ldt"] = cal.SelectedDate;
}
protected void Page_Load(object sender, EventArgs e)
{
dlUserName.Items.Add(new ListItem("erez", "fes"));
}
</script>
<asp:Content ContentPlaceHolderID="ContentPlaceHolder" runat="server">
<script language='javascript'>
function Test()
{
var ldt= new Date(Date.UTC(2007,11,24));
dpc1.refreshCallBack(ldt);
}
</script>
<h2>Example</h2>
<anthem:Calendar id="cal" runat="server"
EnableCallBack="true" EnableViewState="true"
TextDuringCallBack='<img src="tiny_red.gif" border=0 />'
PostCallBackFunction="Test" OnSelectionChanged="cal_SelectionChanged" >
</anthem:Calendar>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" ClientObjectName="dpc1" OnRefresh="DayPilotCalendar1_Refresh">
</DayPilot:DayPilotCalendar>
<asp:DropDownList ID="dlUserName" runat="server">
</asp:DropDownList>
</asp:Content>