M
MU
Hi all,
I have a DetailsView object on my form with the following Template
<asp:TemplateField HeaderText="Start Date"
SortExpression="StartDate">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_StartDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>' ReadOnly="true"></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_EndDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></asp:Label>
</ItemTemplate>
<ControlStyle CssClass="form_textbox_15" />
</asp:TemplateField>
When I click Edit and then add a date using the Calendar control it
adds the date to the text box and when I click Update, no error occur
but the value isn't written to the database, it goes in as blank.
Thoughts? Here is my update statement for the SQLDataSource
UpdateCommand="UPDATE ParticipantItems SET Name = @Name,
Quantity = @Quantity, StartDate = @StartDate, EndDate = @EndDate,
Comments = @Comments, DateUpdated = GETDATE(), AdminID = 1 WHERE
(ItemID = @ItemID)">
Thanks
I have a DetailsView object on my form with the following Template
<asp:TemplateField HeaderText="Start Date"
SortExpression="StartDate">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_StartDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>' ReadOnly="true"></
asp:TextBox><cc1:CalendarExtender
ID="calExtender_EndDate"
runat="server" TargetControlID="TextBox1" Format="MMMM d, yyyy">
</cc1:CalendarExtender>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("StartDate", "{0:MMMM d, yyyy}") %>'></asp:Label>
</ItemTemplate>
<ControlStyle CssClass="form_textbox_15" />
</asp:TemplateField>
When I click Edit and then add a date using the Calendar control it
adds the date to the text box and when I click Update, no error occur
but the value isn't written to the database, it goes in as blank.
Thoughts? Here is my update statement for the SQLDataSource
UpdateCommand="UPDATE ParticipantItems SET Name = @Name,
Quantity = @Quantity, StartDate = @StartDate, EndDate = @EndDate,
Comments = @Comments, DateUpdated = GETDATE(), AdminID = 1 WHERE
(ItemID = @ItemID)">
Thanks