Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
595
WARP+WebDateChooser
posted

Dear all. I've made a control wich consists of WARP with WebDateChooser inside. I need to change the color of entered date (if holiday - date must be red, else - black). Here is my simple code:

<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server">

<igsch:WebDateChooser ID="WebDateChooser1" runat="server" AllowNull="False"

Value="2008-07-21" EnableKeyboardNavigation="True">

<ClientSideEvents CalendarRenderDay="WebDateChooser1_CalendarRenderDay">

</ClientSideEvents>

<CalendarLayout FooterFormat="‘Today: {0:d}">

<DayHeaderStyle BackColor="#EEEEDE" BorderStyle="Outset">

<borderdetails styleleft="None" styleright="None" />

</DayHeaderStyle>

<OtherMonthDayStyle ForeColor="#999999" />

<SelectedDayStyle BackColor="#FFFFCC" ForeColor="Black" />

<TitleStyle BackColor="#A0C0FF" Font-Bold="True" />

<WeekendDayStyle ForeColor="#FF3300" />

<FooterStyle BackColor="#F3F2E7" />

<DropDownStyle BackColor="White">

</DropDownStyle>

</CalendarLayout>

</igsch:WebDateChooser>

</igmisc:WebAsyncRefreshPanel>

 

In Page_Load I check if it is PostBack, then i get Type of the entered date (Restday or Workday) and change the WebDateChooser.ForeColor property. 

 Everything works fine if I enter the date via Calendar (page with my contol is not reloading).  As soon as i enter the date by hands via keyboard and press enter - my page is reloading! That is the problem. I do not know how to press enter in WebDateChooser and do not reload page :(

 

 

  • 24497
    posted

    Hi,

    I think that postback in your app happens due to submit of a Button on enter or something like. If you want to update datechooser on change value from server, then you need to enable autopostback of that datechooser. For example add to it

    <AutoPostBack CalendarMonthChanged="True" ValueChanged="True" />