开发者

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 UpdatePanels for those RadioButtons and CalenderExtenders.


The solution I arrived at was to remove ReadOnly="true".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜