我在我的jquery模板中有一个asp:textbox,如下所示
<script id="ProjectTypeTemplate" type="text/x-jquery-tmpl">
<tr id="trProjType">
<td>${lang_id} </td>
<td><input id="${lang_id}" type="text" /> <span class="RequiredFieldStar">*</span></td>
<td>${merchant_id}</td>
<td>${lang_id}</td>
<td>${name_lang}</td>
</tr>
</script>
我必须对此进行验证
<div id = "Projtypediv">
<table id = "project_type_templ_tbl" border="1" cellspacing="0" style="width:100%;">
<asp:RequiredFieldValidator ID="reqvProjectTypeDescription" runat="server" ErrorMessage="Enter Project Type Description"
ControlToValidate="Id of the inputbox" Display="None"></asp:RequiredFieldValidator> <ajaxToolkit:ValidatorCalloutExtender
runat="Server" ID="vceProjectTypeDescription" TargetControlID="reqvProjectTypeDescription" />
<asp:CustomValidator runat="server" ID="custvProjectTypeDescription" ErrorMessage="Enter characters except (<,>,&#,\) in Project Type Description"
ControlToValidate="Id of the inputbox" Display="None" ClientValidationFunction="checkSpecialCharacter" />
<ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="vceSpCharacterProjectTypeDescription"
TargetControlID="custvProjectTypeDescription" />
</table>
</div>
其中project_type_templ_tbl是包含模板的表的名称
thanx提前帮助
答案 0 :(得分:0)
您可以编写一个简单的JavaScript脚本来触发验证器。
通过添加属性ValidationGroup="YourCustomGroupName"
在同一验证组中移动您需要的验证器,然后您可以使用JS方法:
Page_ClientValidate(“YourCustomGroupName”))