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; using System.Data.SqlClient; using System.Web.Configuration; public partial class _Default : System.Web.UI.Page { string stdt; string endt; string conn; protected void Page_Load(object sender, EventArgs e) { //txtfrmdt.Text = DateTime.Now.ToString(); //txttodt.Text = DateTime.Now.ToString(); if (!IsPostBack) { // string date2 = DateTime.Now.ToString(); // string str = date2.Trim(); //string date1 = str.Substring(0, 10); //string date1 = DateTime.Now.ToShortDateString(); //DateTime dt = Convert.ToDateTime(date1); Calendar2.SelectedDate = DateTime.Now; // Session["connstring"] = Request.QueryString["testupload"].ToString(); } BindCalender(); // bindgrid(); // DropDownList1.SelectedValue = Convert.ToString(Calendar1.SelectedDate); // DropDownList1.SelectedItem.Text = Convert.ToString(Calendar1.SelectedDate); } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Calendar1.Visible = true; // BindCalender(); } protected void ImageButton2_Click1(object sender, ImageClickEventArgs e) { Calendar2.Visible = true; } public void BindCalender() { //txtfrmdt.Text = Calendar1.SelectedDate.ToString(); //txttodt.Text = Calendar2.SelectedDate.ToString(); stdt = Calendar1.SelectedDate.ToString(); string s1 = stdt.Substring(0, 10); txtfrmdt.Text = s1.ToString(); endt = Calendar2.SelectedDate.ToString(); string s2 = endt.Substring(0, 10); txttodt.Text = s2.ToString(); Calendar1.Visible = false; Calendar2.Visible = false; //Response.Redirect("Default2.aspx"); } protected void Calendar1_SelectionChanged(object sender, EventArgs e) { // DropDownList1.Text = Convert.ToString(Calendar1.SelectedDate); // DropDownList1.SelectedItem.Text = Convert.ToString(Calendar1.SelectedDate); stdt = Calendar1.SelectedDate.ToString(); string s1 = stdt.Substring(0, 10); txtfrmdt.Text = s1.ToString(); //Calendar1 .SelectedDate } protected void Calendar2_SelectionChanged(object sender, EventArgs e) { endt = Calendar2.SelectedDate.ToString(); string s2 = endt.Substring(0, 10); txttodt.Text = s2.ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)