Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi


I want to enter a date in database I am using TextMode Date this Show me calendar to enter date ,

I am facing Issue at a time of retrieving Date in textbox date cant be shown Please help me When I remove Textmode Date it work,
Posted
Comments
Kornfeld Eliyahu Peter 29-Mar-15 9:43am    
What issue?
Mantu Singh 29-Mar-15 9:49am    
Code pls
Gurpreet Arora Malhotra 29-Mar-15 10:27am    
Code
Date_Of_Birth_TextBox.Text = Convert.ToDateTime(dt.Rows[0]["Employee_DOB"]);

<asp:TextBox ID="Date_Of_Birth_TextBox" runat="server" TextMode="Date" CssClass="form-control">

If i remove TextMode="Date" its working fine
Kornfeld Eliyahu Peter 29-Mar-15 15:32pm    
The only reason I can see is that you are not using .NET 4.5...
Gurpreet Arora Malhotra 29-Mar-15 16:15pm    
I am Using .NET 4.5

try converting the value to "yyyy-MM-dd" format and then assign it to Joining_Date_TextBox textbox.
 
Share this answer
 
HI Malhotra,

for this use textchangeevent in textbox and use autopostback=true then in textchangeevent you can find the text of selected date.

Thanks
 
Share this answer
 
Comments
Gurpreet Arora Malhotra 9-Apr-15 13:11pm    
Can U please give me example
Joining_Date_TextBox.Text = Convert.ToDateTime(dt.Rows[0]["Employee_Joining_Date"].ToString("yyyy-MM-dd");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900