如何填充日历选择上的文本框已更改

时间:2012-09-19 09:03:25

标签: c# asp.net calendar asp.net-ajax ajaxcontroltoolkit

  <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
   <div style="text-align:center">

        <asp:Calendar ID="myCal" runat="server" Height="600px" width="900px" 
            BorderColor="#F2F3F4" BorderWidth="3px" DayStyle-BorderWidth="1px" 
                    TodayDayStyle-BackColor="#82CAFF" NextPrevFormat="ShortMonth" 
            SelectionMode="Day" DayHeaderStyle-Height="30px" 
                    TitleStyle-BackColor="#CBE3F0" TitleStyle-ForeColor="#153E7E" 
            OtherMonthDayStyle-ForeColor="#B4CFEC" NextPrevStyle-ForeColor="#2554C7" 
            CssClass="mGrid" onselectionchanged="myCal_SelectionChanged">
            <DayHeaderStyle Height="30px" /><TitleStyle Height="50px" />
            <DayStyle BorderWidth="1px" HorizontalAlign="Left" VerticalAlign="Top" />
            <TodayDayStyle BackColor="#CBE3F0" />
        </asp:Calendar>

    </div>

    <asp:Panel ID="pnlSelect" runat="server" width="200px" Height="200px"  >

       <table border="0" cellspacing="6" cellpadding="0" style="background-color:white">
            <tr>
                <td align="right"></td>
                <td>
                    <h2>New Appointment</h2>
                </td>
            </tr>
            <tr>
                <td align="right">Start Date:</td>
                <td><asp:TextBox ID="TextBoxStart" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right">End Date:</td>
                <td><asp:TextBox ID="TextBoxEnd" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right">Name:</td>
                <td><asp:TextBox ID="TextBoxName" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right"></td>
                <td>
                    <asp:Button ID="ButtonOK" runat="server" OnClick="ButtonOK_Click" Text="OK" />
                    <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" OnClick="ButtonCancel_Click" />
                </td>
            </tr>
        </table>

    </asp:Panel>

    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="myCal" PopupControlID="pnlSelect"
         OkControlID="ButtonOK" CancelControlID="ButtonCancel" Drag="True">

    </asp:ModalPopupExtender>

我想在Popup中填充当前日期,但myCal_SelectionChanged事件未触发

我如何实现这一目标

请帮忙

1 个答案:

答案 0 :(得分:0)

您的代码对我来说很好。创建一个新的测试页并使用相同的代码再次尝试 如果它工作,那么..可能是你的页面designer.cs

有问题