I am trying to validate data in a textbox control of a template field within a gridview against the results of a SqlDataSource. The SqlDataSource has 1 column, sku, and if the data entered does not match, I want to display an error message. I have created a CustomValidator to do this, but it does not seem to work. Could someone please provide any feedback as to why it would not work? Below is coding for SqlDataSource, templated field and CustomValidator. Thanks.
<asp:SqlDataSource ID="sdsItemMast" runat="server"
ProviderName="<%$ ConnectionStrings:CommonConnectionString.ProviderName %>"
SelectCommand="SELECT sku FROM [COMMON_INFORMATION].dbo.Item_Master">
<asp:TemplateField HeaderText="SKU" SortExpression="SKU">
<asp:TextBox ID="txbEditSku" runat="server" Text='<%#Bind("Sku")%>'></asp:TextBox>
<asp:CustomValidator ID="cvEditSku" runat="server&quo
View Complete Post