how to use datetimepicker control in
  • datetimepicker in using c# here is source code.


    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

    <html xmlns="">
    <head runat="server">
        <title>Untitled Page</title>
        <form id="form1" runat="server">
         Your selected date is<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Panel Runat="server" ID="Panel1" >
                    <asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="PickDate" ForeColor="Green" ></asp:Calendar>


    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;

    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    private void ToggleCalendar()
    Panel1.CssClass = ("calendarHide" == Panel1.CssClass) ? ("calendarShow") : ("calendarHide");
    //btnDate.Text = ("Hide Calendar" == btnDate.Text) ? ("Show Calendar") : ("Hide Calendar");
    public void PickDate(object sender, EventArgs e)
    TextBox1.Text = Calendar1.SelectedDate.Day.ToString("00") + "/" + Calendar1.SelectedDate.Month.ToString("00") + "/" + Calendar1.SelectedDate.Year.ToString("0000");

    283 x 252 - 17K

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook


Popular Posts of the Week