我已经建立了一个连接到MySQL数据库的事件日历,以及一个可以插入和更新数据的管理页面。我有四个Ajax Toolkit ModalPopUpExtender应该通过隐藏插入和更新表来清理页面,但只隐藏第一个。以下代码对所有这些代码都类似。我不明白为什么只有一个被隐藏。没有代码可以干扰模式弹出扩展器。任何建议都会很棒!
<ajaxToolkit:ModalPopupExtender ID="MPE_InsertEvt" runat="server" BehaviorID="MPE_InsertEvt"
RepositionMode="RepositionOnWindowResizeAndScroll" TargetControlID="BTN_NewEvt"
PopupControlID="TBL_InsertEvent" CancelControlID="BTN_CancelEvt">
</ajaxToolkit:ModalPopupExtender>
我不知道Ajax控件是否可能相互混淆,所以这里是其中一个表的代码。我正在使用文本框水印,蒙面编辑扩展器和蒙面编辑验证器。任何建议都将不胜感激。
<table id="TBL_InsertEvent" runat="server" class="PopUp">
<tr>
<th colspan="3" class="Title">
Insert A New Event
</th>
</tr>
<tr>
<th>
Type:
</th>
<td>
<asp:DropDownList ID="DDL_Type" runat="server" CssClass="BigText">
<asp:ListItem Value="Other"></asp:ListItem>
<asp:ListItem Value="Natural"></asp:ListItem>
<asp:ListItem Value="Public"></asp:ListItem>
<asp:ListItem Value="Members"></asp:ListItem>
<asp:ListItem Value="Sports"></asp:ListItem>
<asp:ListItem Value="Holiday"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<th>
Name:
</th>
<td>
<asp:TextBox ID="TB_Name" runat="server" CssClass="BigText" CausesValidation="True"
AutoComplete="off"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RFV_EventName" runat="server" Text="*" ControlToValidate="TB_Name"
CssClass="Validate" Display="Dynamic" ErrorMessage="An event name is required."
ValidationGroup="EventFrm"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<th>
Host:
</th>
<td colspan="2">
<asp:TextBox ID="TB_Host" runat="server" CssClass="BigText" ValidationGroup="EventFrm"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TBW_Host" runat="server" TargetControlID="TB_Host"
WatermarkCssClass="Watermark BigText" WatermarkText="Who is running the event?">
</ajaxToolkit:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<th>
Location
</th>
<td colspan="2">
<asp:TextBox ID="TB_Location" runat="server" CssClass="BigText" ToolTip="Where does the event take place?"></asp:TextBox>
<ajaxToolkit:TextBoxWatermarkExtender ID="TBW_Location" runat="server" TargetControlID="TB_Location"
WatermarkCssClass="Watermark BigText" WatermarkText="Where does the event take place?">
</ajaxToolkit:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<th>
Date:
</th>
<td>
<asp:TextBox ID="TB_Date" runat="server" CssClass="BigText" CausesValidation="true"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="MEE_Date" runat="server" MaskType="Date" Mask="9999-99-99"
TargetControlID="TB_Date" UserDateFormat="YearMonthDay" AcceptAMPM="false">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:TextBoxWatermarkExtender ID="TBW_Date" runat="server" TargetControlID="TB_Date"
WatermarkCssClass="Watermark BigText" WatermarkText="2013-01-01">
</ajaxToolkit:TextBoxWatermarkExtender>
</td>
<td>
<ajaxToolkit:MaskedEditValidator ID="MEV_Date" runat="server" ControlExtender="MEE_Date"
ControlToValidate="TB_Date" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
Display="Dynamic" IsValidEmpty="false" TooltipMessage="Input a date" InvalidValueBlurredMessage="*"
ValidationGroup="MKE"></ajaxToolkit:MaskedEditValidator>
</td>
</tr>
<tr>
<th>
Start Time:
</th>
<td>
<asp:TextBox ID="TB_StartTime" CssClass="BigText" runat="server"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="MEE_StartTime" runat="server" AcceptAMPM="true"
MaskType="Time" Mask="99:99" TargetControlID="TB_StartTime">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:TextBoxWatermarkExtender ID="TBW_StartTime" runat="server" TargetControlID="TB_StartTime"
WatermarkCssClass="Watermark BigText" WatermarkText="12:00 AM">
</ajaxToolkit:TextBoxWatermarkExtender>
</td>
<td>
<ajaxToolkit:MaskedEditValidator ID="MEV_StartTime" runat="server" CssClass="Validate"
ControlExtender="MEE_StartTime" ControlToValidate="TB_StartTime" Display="Dynamic"
IsValidEmpty="false" EmptyValueMessage="When does the event start? If the event is a holiday or a day-long event, <br /> enter "00:00" to indicate it lasts all day."
InvalidValueMessage="Please enter values between "12:00 AM" and "11:59 PM"."
MaximumValue="11:59 PM" MinimumValue="00:00 AM" Text="*" ValidationGroup="EventFrm"></ajaxToolkit:MaskedEditValidator>
</td>
</tr>
<tr>
<th>
End Time:
</th>
<td>
<asp:TextBox ID="TB_EndTime" CssClass="BigText" runat="server"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="MEE_EndTime" runat="server" AcceptAMPM="true"
MaskType="Time" Mask="99:99" TargetControlID="TB_EndTime">
</ajaxToolkit:MaskedEditExtender>
<ajaxToolkit:TextBoxWatermarkExtender ID="TBW_EndTime" runat="server" TargetControlID="TB_EndTime"
WatermarkCssClass="Watermark BigText" WatermarkText="11:59 PM">
</ajaxToolkit:TextBoxWatermarkExtender>
</td>
<td>
<ajaxToolkit:MaskedEditValidator ID="MEV_EndTime" runat="server" CssClass="Validate"
ControlExtender="MEE_EndTime" ControlToValidate="TB_EndTime" Display="Dynamic"
IsValidEmpty="false" EmptyValueMessage="When does the event end? If the event is a holiday or a day-long event, <br /> enter "00:00" to indicate it lasts all day."
InvalidValueMessage="Please enter values between "12:00 AM" and "11:59 PM"."
MaximumValue="11:59 PM" MinimumValue="12:00 AM" Text="*" ValidationGroup="EventFrm"></ajaxToolkit:MaskedEditValidator>
</td>
</tr>
<tr>
<th>
Description:
</th>
<td colspan="2">
<asp:TextBox ID="TB_Description" runat="server" CssClass="BigText" TextMode="MultiLine"
MaxLength="50"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="BTN_InsertEvt" runat="server" CssClass="BigText" Text="OK" ValidationGroup="EventFrm" />
</td>
<td>
<asp:Button ID="BTN_ResetEvtInsert" runat="server" CssClass="BigText" Text="Reset" />
</td>
<td>
<asp:Button ID="BTN_CancelEvtInsert" runat="server" CssClass="BigText" Text="Cancel" />
</td>
</tr>
</table>