I looking single ajax calendar extender for multiple text boxes and (calendar) image controls?
how can we do that? I found below good article on textboxes (not calendar images) controls.
Please help me to get this with i开发者_如何学JAVAmage controls also
link text
<script type="text/javascript" language="javascript">
function onlybackbutton(id) {
if (id == 1) {
document.getElementById('<%=txtCdatefrom.ClientID%>').value = "";
document.getElementById('<%=imgdatefrom.ClientID%>').click();
}
else if (id == 2) {
document.getElementById('<%=txtCdateTo.ClientID%>').value = "";
document.getElementById('<%=imgdateto.ClientID%>').click();
}
return false;
}
</script>
<table>
<tr>
<td>
Created Date From
</td>
<td>
<asp:TextBox ID="txtCdatefrom" runat="server" Width="180px" onpaste="return false;" onmousedown="return onlybackbutton(1);" onkeypress="return onlybackbutton(1);"></asp:TextBox>
<asp:ImageButton ID="imgdatefrom" runat="server" ImageUrl="~/images/DatePicker.gif"
ImageAlign="Baseline" Height="16px" />
<asp:CalendarExtender ID="calsearchdtfrm" runat="server" Enabled="True" TargetControlID="txtCdatefrom"
Format="yyyy/MM/dd" PopupButtonID="imgdatefrom">
</asp:CalendarExtender>
</td>
<td>
Created Date To
</td>
<td>
<asp:TextBox ID="txtCdateTo" runat="server" Width="180px" onpaste="return false;" onmousedown="return onlybackbutton(2);" onkeypress="return onlybackbutton(2);"></asp:TextBox>
<asp:ImageButton ID="imgdateto" runat="server" Height="16px" ImageUrl="~/images/DatePicker.gif" />
<asp:CalendarExtender ID="txtsearchdtto_CalendarExtender" runat="server" Enabled="True"
TargetControlID="txtCdateTo" Format="yyyy/MM/dd" PopupButtonID="imgdateto">
</asp:CalendarExtender>
</td>
</tr></table>
Obout has a pretty awesome library that includes an AJAX Calendar control.
精彩评论