posts - 9, comments - 4, trackbacks - 0, articles - 9

textbox与Calendar的绑定

Posted on 2011-01-19 22:40 xlz 阅读(606) 评论(1)  编辑 收藏 引用
protected void Page_Load(object sender, EventArgs e)
    {
        this.Calendar1.Attributes.Add("style", "display:none;border-width:1px;border-style:solid;border-collapse:collapse;z-index: 100; left: 0px;");
        TextBox1.Attributes.Add("onfocus", "javascript:document.getElementById('Calendar1').style.display=''");
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        TextBox1.Text = this.Calendar1.SelectedDate.ToShortDateString();
        Calendar1.Attributes.Add("onblur", "javascript:document.getElementById('Calendar1').style.display='none'");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Console.Write(this.TextBox1.Text);

Feedback

# re: textbox与Calendar的绑定  回复  更多评论   

2012-02-13 10:57 by vxcb
vcxvxc

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理