Auto value date & time in DetailsView not updating
i want to ask some help to view my code. I want to update the auto value i
create in detailsview textbox currently i format it to show time and date.
the problem is when i click update the value not update.FYI ID is in Malay
like WaktuKeluar is Time Out
Code :
<EditItemTemplate>
<asp:TextBox
ID="txtWaktuKeluar" runat="server"
Text='<%# Bind("WaktuKeluar") %>'
OnDataBinding="txtWaktuKeluar"></asp:TextBox>
<asp:RequiredFieldValidator ID="ReqInsertDateTime"
runat="server" ControlToValidate="txtWaktuKeluar"
Font-Bold="True"
Font-Italic="True" ForeColor="Red"
SetFocusOnError="True"
Display="Dynamic"></asp:RequiredFieldValidator>
</EditItemTemplate>
Code behind :
Protected Sub txtWaktuKeluar(ByVal sender As Object, ByVal e As EventArgs)
Dim txtBox As TextBox
txtBox = DetailsView1.FindControl("txtWaktuKeluar")
txtBox.Text = DateTime.Now
End Sub
Please help me.
No comments:
Post a Comment