Rank: Newbie Groups: Member
Joined: 9/1/2010 Posts: 6
|
I'm trying to figure out the reason that my DayRender function is not disabling the dates denoted in my function. Could someone shed some light on my error here. All I could find with my own research was that it is possible related to an update panel. However I'm a bit new to ajax's relationship to ASP.Net. Thanks for any help on this one, Ryan
Code: C#
public void DatePicker1_DayRender(object sender, EO.Web.DayRenderEventArgs e)
{
if (e.Day.IsOtherMonth)
{
e.Writer.Write("<span class='otherMonth'>{0}</span>", e.Day.DayNumberText + "%");
}
else if (e.Day.IsWeekend || e.Day.DayNumberText.EndsWith("3"))
{
e.Day.IsSelectable = false;
e.Writer.Write("<span class='nonWorkingDay'>{0}</span>", e.Day.DayNumberText + "*");
}
else
{
e.Writer.Write("<span class='workingDay'>{0}</span>", e.Day.DayNumberText + "-");
}
}
Code: HTML/ASPX
<%@ Register TagPrefix="eo" assembly="EO.Web" namespace="EO.Web" %>
<div class="shippingDateSelection-block">
<div id="shippingDateSelection">Select Shipping Date</div>
<eo:Calendar runat="server" id="Calendar1" DayCellWidth="21" DayHeaderFormat="FirstLetter"
DayCellHeight="16" GridLineFrameVisible="False" TitleLeftArrowHtml="&lt;" TitleFormat="MMM yyyy"
TitleRightArrowHtml="&gt;" GridLineColor="207, 217, 227" GridLineVisible="True"
OnSelectionChanged="select_CalendarDate" AutoPostbackOnSelect="true" MonthColumns="2"
OnDayRender="DatePicker1_DayRender" >
<DayStyle CssText="border-right: #eaeaea 1px solid; border-top: #eaeaea 1px solid; border-left: #eaeaea 1px solid; border-bottom: #eaeaea 1px solid; background-color: #eaeaea"></DayStyle>
<SelectedDayStyle CssText="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid; background-color: white"></SelectedDayStyle>
<TitleStyle CssText="padding-right: 3px; padding-left: 3px; font-weight: bold; padding-bottom: 3px; color: white; padding-top: 3px; border-bottom: #cfd9e3 1px solid; background-color: #006699; font-size: 11px; font-family: verdana;"></TitleStyle>
<CalendarStyle CssText="border-right: #cfd9e3 1px solid; border-top: #cfd9e3 1px solid; font-size: 11px; border-left: #cfd9e3 1px solid; cursor: hand; border-bottom: #cfd9e3 1px solid; font-family: verdana; background-color: #eaeaea"></CalendarStyle>
<DayHoverStyle CssText="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid; background-color: white"></DayHoverStyle>
<MonthStyle CssText="font-size: 11px; font-family: verdana;"></MonthStyle>
<DayHeaderStyle CssText="height: 17px"></DayHeaderStyle>
</eo:Calendar>
<div id="ship-date-hidden">
<asp:TextBox ID="txtSelectedDate" runat="server" />
<asp:TextBox ID="lblDateShipDebug" runat="server" Width="100" Height="50" TextMode="MultiLine"/>
</div>
</div>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The code you posted looks fine to us. However I am not exactly sure what you mean by "my DayRender function is not disabling the dates" because DayRender actually has nothing to do with whether a day cell is enabled or disabled. Whether a day cell is enabled or disabled are controlled by a number of other properties (MaxValidDate, MinValidDate, DisableWeekendDays and DisabledDates). DayRender allows you to custom render a day cell, but that does not change anything regarding how the day cell handles mouse click event (unless you render extra code to handle mouse click event in your rendering function).
AJAX is something else that sometime can cause all kind of issues if not used properly. If you are not familiar with AJAX, I would suggest you to try to get everything working before enabling AJAX. It's very easy to AJAX enable your code/page once everything else is already working correctly.
Hope this helps. Please feel free to let us know if you have any more question.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 9/1/2010 Posts: 6
|
Excellent, I may have just been mistakenly using the wrong function for trying to disable my dates. I'll make some changes and post a solutions once I get to one. I'm sure its something very simple.
As always, thanks for the extremely quick response. - Ryan
|