Ivoking comparevalidator

  • Thread starter Sjaakie Helderhorst
  • Start date
S

Sjaakie Helderhorst

Hi,

Somehow pushing an image-button doesn't trigger the CompareValidator,
resulting in errors when entering string characters.
Could someone please tell me what I did wrong?
Thanks in advance!

See datagrid code below:

<asp:DataGrid id="gridProducts" ....>
....
<ItemTemplate>
<asp:TextBox ID="amount" BorderStyle="Solid"
Width="40" Runat="server" MaxLength="5"
Text='<%# DataBinder.Eval(Container.DataItem, "amount") %>'
Font-Size="11px">
</asp:TextBox>
<asp:CompareValidator ControlToValidate="amount"
ErrorMessage="*" Operator=DataTypeCheck Type=Integer
Runat="server" Display="Dynamic">
</asp:CompareValidator>
</ItemTemplate>
<asp:ButtonColumn Text="&lt;img src='./images/button_order.gif'
border=0&gt;" HeaderText="OK" CommandName="Submit">
</asp:ButtonColumn>
</columns>
</asp:DataGrid>

Code-behind:

Private Sub gridProducts_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
gridProducts.ItemCommand
.... <updating a dataset with amount-value here>
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top