我正在使用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 :(得分: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>
答案 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>
无需使用图像按钮进行日历。
答案 2 :(得分: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" />
答案 3 :(得分:-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>