AjaxToolkit:ValidatorCalloutExtender
没有处理UpdatePanel
为什么?
当我在没有更新面板的情况下运行ValidatorCalloutExtender
时,它可以正常工作;
但是当申请updatepanel
时,它无效。
validator
在更新面板中调用代码,但它仍然无效。
任何人都可以告诉我为什么?
代码:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
<asp:ScriptReference Path="~/Scripts/AjaxControlToolkit/Bundle" />
</Scripts>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<table>
<tr> <td>Full Name :</td>
<td style="width: 235px">
<asp:TextBox ID="TextBox2" runat="server" CssClass="form-control" Width="220px" Height="40px"></asp:TextBox>
<br />
<asp:RequiredFieldValidator runat="server" ID="NReq"
ControlToValidate="TextBox2"
Display="None"
SetFocusOnError="true"
ErrorMessage="<b>Required Field Missing</b><br />Full Name Is Required." />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="NReqE"
TargetControlID="NReq"
HighlightCssClass="validatorCalloutHighlight" />
</td>
</tr>
<tr> <td>Father Name :</td>
<td style="width: 235px">
<asp:TextBox ID="TextBox3" runat="server" CssClass="form-control" Width="220px" Height="40px"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2"
ControlToValidate="TextBox3"
Display="None" DisplayOnClick="true"
SetFocusOnError="true"
ErrorMessage="<b>Required Field Missing</b><br />Father Name Is Required." />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1"
TargetControlID="RequiredFieldValidator2"
HighlightCssClass="validatorCalloutHighlight" />
</td>
</tr>
<tr> <td>
</td> <td style="width: 235px">
<br />
<asp:Button ID="Button1" runat="server" Text="Add Missing Person Detail" Height="40px" Width="220px" OnClick="Button1_Click" CssClass="btn-warning" />
</td></tr>
</table>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Button1"/>
</Triggers>
</asp:UpdatePanel>