Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Ajax Calendar Extension
Ravi Pandit
Sep 23 2017 6:16 AM
206
Reply
I want to store the date into database but it is taking only the default date 01-Jan-1900. Please tell me how i can save the selected date into database and reflect it in the gridview
My Code is:
Design:
<tr>
<td>
<label>Date Of Birth</label>
</td>
<td>
<asp:TextBox ID="txtDateForm" runat="server" Placeholder="dd-MMM-yyyy"></asp:TextBox>
<asp:ImageButton ID="popdate" ImageUrl="~/calender.jpg" runat="server" Height="16px" Width="17px" />
<asp:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="popdate" TargetControlID="txtDateForm" Format="dd-MMM-yyyy"></asp:CalendarExtender>
</td>
</tr>
Aspx.cs
if (!string.IsNullOrEmpty(txtDateForm.Text.Trim()))
{
date = DateTime.Parse(txtDateForm.Text.Trim());
}
cmd.Parameters.AddWithValue("@RegDate", date);
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Dynamically bind Id to a Datatable column
telerik radgrid pdf,excel,csv,word download not working