Hi
I am Unable to Retrieve Date in Textbox(Joining Date Textbox)
Here the Code
Aspx File
<div class="form-grou">
<asp:Label ID="Date_Of_Birth_Label" runat="server" CssClass="col-lg-4 control-label" Text="Date Of Birth"></asp:Label>
<div class="col-lg-8">
<asp:TextBox ID="Date_Of_Birth_TextBox" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="Date_Of_Birth_TextBox" runat="server" ForeColor="Red" Display="Dynamic" SetFocusOnError="true" ErrorMessage="Date Of Birth Is Mandatory"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-grou">
<asp:Label ID="Email_Address_Label" runat="server" CssClass="col-lg-4 control-label" Text="Email Address"></asp:Label>
<div class="col-lg-8">
<asp:TextBox ID="Email_Address_TextBox" runat="server" TextMode="Email" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="Email_Address_TextBox" runat="server" ForeColor="Red" Display="Dynamic" SetFocusOnError="true" ErrorMessage="Email Address Is Mandatory"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-grou">
<asp:Label ID="Contact_No_Label" runat="server" CssClass="col-lg-4 control-label" Text="Phone No"></asp:Label>
<div class="col-lg-8">
<asp:TextBox ID="Contact_No_TextBox" MaxLength="10" onkeypress='return event.charCode >=48 && event.charCode <=57' runat="server" Text="0" CssClass="form-control"></asp:TextBox>
</div>
</div>
<div class="form-grou">
<asp:Label ID="Joining_Date_Label" runat="server" CssClass="col-lg-4 control-label" Text="Joining Date"></asp:Label>
<div class="col-lg-8">
<asp:TextBox ID="Joining_Date_TextBox" TextMode="Date" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" ControlToValidate="Joining_Date_TextBox" runat="server" ForeColor="Red" Display="Dynamic" SetFocusOnError="true" ErrorMessage="Joining Date Mandatory"></asp:RequiredFieldValidator>
</div>
</div
>
aspx.cs
string Connection_string = System.Configuration.ConfigurationManager.ConnectionStrings["CMMS_Standard"].ToString();
byte Employee_Tittle = 0;
Int16 Created_by_Employee_Id = 0;
byte Employee_Designation_ID = 0;
Int16 Employee_Id = 0;
byte Deparment_id = 0;
string Id = "";
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["E_Id"] != null)
{
string Username = User.Identity.Name;
Employee_Detail Employee_Detail_Class = new Employee_Detail();
Employee_Detail_Class.Retrieve_User_Id(ref Connection_string, ref Username, out Created_by_Employee_Id);
Id = Request.QueryString["E_Id"];
Employee_Id = Convert.ToInt16(Employees_detail_id_code.retrive_id(Id));
if (!IsPostBack)
{
Load_Designation();
DataTable dt;
Employee_Detail_Class.Retrieve_Employee_Details_By_Id(ref Connection_string, ref Employee_Id, out dt);
if (dt.Rows.Count > 0)
{
Date_Of_Birth_TextBox.Text = Convert.ToDateTime(dt.Rows[0]["Employee_DOB"]).ToString("dd-MM-yyyy");
Joining_Date_TextBox.Text = Convert.ToDateTime(dt.Rows[0]["Employee_Joining_Date"]).ToString("dd/MM/yyyy");
}
}
}
else
{
Response.Redirect("~/Error.aspx");
}
In Date Of Birth TextBox I retrive Date , But in Joining Date I am Unable to retrieve Date . I use textmode date , Please help How I retreive date with Textmode date Property