0

如何将Requiredfieldvalidator控件添加(绑定)到formview itemtemplate?

     <tr runat="server" > 
         <td style="width: 120px">

             <asp:Label Text="Purchase Org.:" ID="LabelPurchOrg1" runat="server">  </asp:Label>
       </td>
        <td>
            <orbit:Control runat="server" ID="Purch" Text='<%# Eval("Site")%>'                    LabelPosition="Right" CssClassLabel="SectionTextLookup"   RenderTextBoxAsLabel="true" EnableLabel="true" EnableTooltip="true" LookupCommand="sit" />

           <asp:RequiredFieldValidator ID="PurchaseOrg" runat="server" ControlToValidate='<%#   Eval("Site") %>'   ErrorMessage="<" EnableClientScript="false" Enabled="false" >
        </asp:RequiredFieldValidator>
      </td>
  </tr>
</table>
</ItemTemplate>
4

1 回答 1

0

所以你只需要改变RequiredFieldValidator如下:

<asp:RequiredFieldValidator ID="PurchaseOrg" runat="server" 
ControlToValidate="Purch" ErrorMessage="<" EnableClientScript="false" 
Enabled="false" ></asp:RequiredFieldValidator>
于 2012-09-14T06:11:06.190 回答