我正在使用一个模态弹出扩展器,它包含一个具有三个文本框和两个按钮的面板。我想用我的规范(选择的日期)填充文本框值..但没有成功。
protected void myCal_SelectionChanged(object sender, EventArgs e)
{
ModalPopupExtender1.Show();
TextBoxStart.Text = myCal.SelectedDate.ToString();
TextBoxEnd.Text = myCal.SelectedDate.ToString();
}
设计师是
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<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>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="ButtonDummy" PopupControlID="pnlSelect">
</ajaxToolkit:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<ContentTemplate>
<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>
</ContentTemplate>
有什么问题?