求代码,谢谢!

解决方案 »

  1.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    if(!this.IsPostBack)
    this.Calendar1.Visible=false;
    // 在此处放置用户代码以初始化页面
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.Calendar1.SelectionChanged += new System.EventHandler(this.Calendar1_SelectionChanged);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void Button1_Click(object sender, System.EventArgs e)
    {
    if(this.Calendar1.Visible)
    this.Calendar1.Visible=false;
    else
    this.Calendar1.Visible=true;
    } private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
    {
    this.TextBox1.Text=this.Calendar1.SelectedDate.ToShortDateString();
    this.Calendar1.Visible=false;
    }
      

  2.   

    最好还是用js控件或者也得采用ajax,这样减少刷新
    如果你使用js的话,建议你使用梅花雨的控件
    具体可以看
    http://www.cnblogs.com/xujh/archive/2005/01/20/94543.html
      

  3.   

    试一下htc的日历组件吧,很好用.
    http://potato.blog.hexun.com/1837577_d.html
    http://www.mltang.com/article/0c159ac2-6f91-4601-96c5-2274b5c0e3ee.html或搜 htc 日历.