2014-02-11 115 views
0

我使用Ajax的日曆日期選擇器。當我點擊日曆圖像時,頁面將得到回傳,但日曆彈出窗口不會彈出。如何解決這個問題?阿賈克斯日曆不工作

在此先感謝。

<asp:TextBox ID="txt_FromDate" runat="server" AutoPostBack="True" 
       ontextchanged="txt_FromDate_TextChanged> 
</asp:TextBox> 
<cc1:CalendarExtender ID="cal_FromDate" PopupButtonID="ibtnFromDate" 
         runat="server" TargetControlID="txt_FromDate" 
         Format="MM/dd/yyyy"> 
</cc1:CalendarExtender>  
<asp:ImageButton ID="ibtnFromDate" 
        ImageUrl="~/_layouts/images/PayrollImages/calendar.gif" 
        ImageAlign="Bottom" runat="server"/> 
+0

爲什麼您使用自動回? –

+0

@ user3295669張貼的代碼工作對我很好..! – pravprab

+1

我想這個問題是不是與日曆擴展,檢查爲什麼回傳出現的原因是什麼?您在日曆擴展程序代碼中進行換行的位置?你能告訴我們的代碼? –

回答

0

試試這個,

<asp:TextBox ID="txt_from" placeholder="MM/DD/YYYY" runat="server" 
      AutoPostBack="True" ontextchanged="txt_from_TextChanged"> 
</asp:TextBox> 
<cc1:CalendarExtender ID="txt_from_CalendarExtender" runat="server" 
         Format="MM/dd/yyyy" Enabled="True" 
         TargetControlID="txt_from"> 
</cc1:CalendarExtender> 

沒有必要使用圖像按鈕日曆。

-1

你只是缺少CalanderExtender PopupButtonID的屬性。請嘗試以下

<asp:TextBox ID="txt_FromDate" runat="server" AutoPostBack="True" 
      ontextchanged="txt_FromDate_TextChanged"> 
</asp:TextBox> 

<asp:ImageButton ID="ibtnFromDate" 
       ImageUrl="~/_layouts/images/PayrollImages/calendar.gif" 
       ImageAlign="Bottom" runat="server"/> 

<cc1:CalendarExtender ID="cal_FromDate" PopupButtonID="ibtnFromDate" 
         runat="server" PopupButtonID="ibtnFromDate" 
         TargetControlID="txt_FromDate" Format="MM/dd/yyyy"> 
</cc1:CalendarExtender>  
+0

-1他不是misiing「PopupButtonID」,你錯了 – pravprab

1

試試這個:

<asp:TextBox ID="btn1" runat="server"> 
</asp:TextBox> 

<asp:ImageButton ID="img1" runat="server" 
       ImageUrl="~/_layouts/images/PayrollImages/calendar.gif"/> 

<cc1:CalendarExtender ID="calendar1" runat="server" PopupButtonID="img1" 
         TargetControlID="btn1" Enabled="True"> 
</cc1:CalendarExtender> 
0
<asp:TextBox ID="txtDOB" runat="server" Width="50%"></asp:TextBox> 

<cc1:CalendarExtender ID="txtDOB_CalendarExtender" runat="server" 
         TargetControlID="txtDOB" 
         Format="MM/dd/yyyy" PopupButtonID="imgDate" 
         PopupPosition="BottomLeft"> 
</cc1:CalendarExtender> 

<asp:Image ID="imgDate" AlternateText="Image Date" 
      ImageUrl="~/Images/Calendar.png" runat="server" />