1

我正在使用CalendarExtender控件<img>来填充TextBox日期。我正在使用这个EditItemTemplateGridView但是当我点击图片时,日历控件没有弹出。

我也在CalendarExtender其他四五个地方(在这个项目中)使用过这个控件。在其他任何地方都运行良好。我已经将运行良好版本的代码与此代码进行了比较。完全没有区别。

我编写了如下代码:

<EditItemTemplate>
    <asp:TextBox ID="txtDateDelivered" runat="server" 
                 Text='<%# Bind("DateDelivered","{0:dd/MM/yy}") %>' 
                 CssClass="DateTextBoxInGridView" >
    </asp:TextBox>
    <asp:CalendarExtender ID="calexDateDelivered" runat="server" 
                          Format="dd/MM/yy" 
                          TargetControlID="txtDateDelivered"
                          PopupButtonID="calDateDelivered">
    </asp:CalendarExtender>
    <img src="Images/calendar.gif" 
         id="calDateDelivered" 
         alt="Calendar" />
</EditItemTemplate>

任何人都可以请告诉可能是哪里的问题?

4

2 回答 2

0

你在网格中有多少行?也可能您有多个具有此类 ID 的图像

于 2011-09-19T14:42:33.793 回答
0

您使用的图像标签不是服务器控件。它是简单的html控件,这就是为什么日历控件不协调这个图像控件的原因..

尝试在此处使用 asp.net 图像按钮而不是 . 它应该工作。

干杯....

拉胡尔 C.

于 2011-09-20T07:00:50.563 回答