ajaxToolkit:CalendarExtender losses data @ postbacks
Frens,
i have a textbox with ajaxToolkit:CalendarExtender which losses data when i chose radio buttons .... please read my code...
<asp:UpdatePanel ID="uppnl_Select_File_Format" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="input-field-box-container">
<asp:TextBox ID="txtExpiryDate" runat="server"
SkinID="FormInputTextBox" ReadOnly="true"
ValidationGroup="PublishUser"> </asp:TextBox>
<ajaxToolkit:CalendarExtender ID="ajax_Expiry_Date" runat="server" TargetControlID="txtExpiryDate">
</ajaxToolkit:CalendarExtender>
</div>
<div class="input-field-box-container">
<asp:RadioButton ID="rbtnEnabled" GroupName="Print" Text="Enable" runat="server"
AutoPostBack="true"
OnCheckedChanged="rbtnEnabled_CheckedChanged" CssClass="checkbox-auto"
Width="220px" />
<asp:RadioButton ID="rbtnDisabled"
GroupName="Print" Text="Disable" runat="server开发者_如何学Go"
AutoPostBack="true" OnCheckedChanged="rbtnDisabled_CheckedChanged" CssClass="checkbox-auto"
Width="220px" />
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnCreate" />
<asp:AsyncPostBackTrigger ControlID="ajax_Expiry_Date" />
</Triggers>
</asp:UpdatePanel>
Your radioButton's AutoPostback
attribute(or what it is called) is true that means when you change the choice of radio button the page will post back and which will cause to refresh the UpdatePanel.As long as your radio button and CalenderExtender is on the same UpdatePanel every time OnCheckedChanged="rbtnDisabled_CheckedChanged"
works CalenderExtender will loose data.
Well you can understand that your solution is using different UpdatePanel
s for those RadioButton
s and CalenderExtender
s.
The solution I arrived at was to remove ReadOnly="true"
.
精彩评论