user829364
user829364

Reputation: 53

DetailsView and EditItemTemplate

me problem is next:

I have a DetailsView control with many editItemTemplates some work fine but i have one dont work's.

code here:

<asp:TemplateField HeaderText="Date" SortExpression="date">
    <ItemTemplate>
        <%#this.putDate(Eval("fecha")) %>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="date" runat="server" ></asp:TextBox>
        <asp:CalendarExtender id="CE" runat="server" Format="dd/MM/yyyy" 
            PopupButtonID="calImg" TargetControlID="date">
        </asp:CalendarExtender>
        <asp:ImageButton id="calImg" runat="server" CommandName="" 
            ImageUrl="img/imgCal.gif" />
    </EditItemTemplate>
</asp:TemplateField>

In view mode the information appear right but in edit mode after select new date with calendar and pres accept to update information, the data dont update. Any idea?

Thz!

Upvotes: 0

Views: 1653

Answers (1)

Brian Mains
Brian Mains

Reputation: 50728

Replace:

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

With:

<asp:TextBox ID="date" runat="server" Text='<%# Bind("SelectedDate") %>'></asp:TextBox>

Upvotes: 1

Related Questions