弹出日历菜单(PopuControl)

前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="AJAXEnabledWebApplication1.test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>测试页面</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="sm" runat="server">
        </asp:ScriptManager>
        <asp:TextBox ID="lbPopup" runat="server"></asp:TextBox>
        <ajaxToolkit:PopupControlExtender ID="pecDate" runat="server" PopupControlID="pDate" TargetControlID="lbPopup">
        </ajaxToolkit:PopupControlExtender>
        <asp:Panel ID="pDate" runat="server">
            <asp:UpdatePanel ID="upDate" runat="server">
            <ContentTemplate>
                <asp:Calendar ID="Calendar1" runat="server" Height="161px" Width="209px" OnSelectionChanged="Calendar_SelectionChanged">
                    <TodayDayStyle BackColor="#FFC080" />
                </asp:Calendar>
            </ContentTemplate>
            </asp:UpdatePanel>
        </asp:Panel>
        &nbsp;
    </div>
    </form>
</body>
</html>

后台:

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;

namespace AJAXEnabledWebApplication1
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Calendar_SelectionChanged( object sender, EventArgs e)
        {
            pecDate.Commit(Calendar1.SelectedDate.ToShortDateString());
        }
    }
}

 

posted on 2009-07-19 15:28  晴天1848  阅读(265)  评论(0)    收藏  举报