rr.aspx.cs

来自「it is designed using asp.net2005 and c#」· CS 代码 · 共 66 行

CS
66
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{

    protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (TextBox2.Text.Trim() != "")
                cdrCalendar2.SelectedDate = Convert.ToDateTime(TextBox2.Text);
        }
        catch
        { }
        cdrCalendar2.Visible = true;  //showing the calendar.

    }
    protected void cdrCalendar1_SelectionChanged(object sender, EventArgs e)
    {
        if (cdrCalendar1.SelectedDate >= DateTime.Parse(DateTime.Now.ToShortDateString()))
        {
            TextBox1.Text = cdrCalendar1.SelectedDate.ToShortDateString();
            //TextBox2.Text = cdrCalendar1.SelectedDate.ToString();
            cdrCalendar1.Visible = false; //hiding the calendar.
        }
        else
        {
            TextBox1.Text = "sorry";
        }
    }
    protected void cdrCalendar2_SelectionChanged(object sender, EventArgs e)
    {
        if (cdrCalendar1.SelectedDate >= DateTime.Parse(DateTime.Now.AddDays(1).ToShortDateString()))
        {
            TextBox2.Text = cdrCalendar2.SelectedDate.ToShortDateString();
            cdrCalendar2.Visible = false; //hiding the calendar.
        }
        else
        {
            TextBox2.Text = "sorry";

        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (TextBox1.Text.Trim() != "")
                cdrCalendar1.SelectedDate = Convert.ToDateTime(TextBox1.Text);
        }
        catch
        { }
        
        cdrCalendar1.Visible = true;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?