0
<asp:Panel runat="server" ID="mainPnl">
    <asp:Calendar FirstDayOfWeek="Monday" WeekendDayStyle-CssClass="weekendStyle" ID="TCInBound"
        runat="server" CssClass="calendar" DayStyle-CssClass="DayStyle" DayHeaderStyle-CssClass="DayHeaderStyle"
        CellPadding="0" CellSpacing="0" TitleStyle-CssClass="TitleStyle" OnDayRender="TCInBound_DayRender"
        OnVisibleMonthChanged="TCInBound_VisibleMonthChanged" NextPrevFormat="CustomText"
        NextPrevStyle-HorizontalAlign="Left" TitleForvermat="MonthYear" Width="100%" Visible="false"
        UseAccessibleHeader="false"></asp:Calendar>
    <asp:HiddenField ID="hdnPrefAirlineCodes" runat="server" />
</asp:Panel>
<telerik:radajaxmanager id="RadAjaxManager1" runat="server" clientevents-onrequeststart="start">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="TCInBound">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="mainPnl" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:radajaxmanager>

And below is JavaScript

function start(sender, args) {
    var hdnPrefAirlineCodes = '<%=hdnPrefAirlineCodes.ClientID %>';
    $('#' + hdnPrefAirlineCodes).val('');
}

When I click any event on calender, it works fine but the hidden value is not set to null on codebehind. I want updated hidden field value on codebehind.

DanM7
  • 2,203
  • 3
  • 28
  • 46
Brijesh Gandhi
  • 560
  • 2
  • 10
  • 27

2 Answers2

0

Maybe it's better to use standard microsoft and dom technology, try this:

function start(sender, args) {
    $get("<%= hdnPrefAirlineCodes.ClientID %>").value = "";
}

Tell me if it works!

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
0

Here is how to set your hidden field to null in JavaScript:

function start(sender, args) {
    document.getElementById("hdnPrefAirlineCodes").value = null;
}
DanM7
  • 2,203
  • 3
  • 28
  • 46