views:

274

answers:

1

Hi,

I have a validation problem

I have a listview, in the edit item template I have two composite controls with a textbox inside

I put a comparevalidator on it

<asp:CompareValidator ID="myCompareValidator" runat="server"
ControlToValidate="mycompositecontrol1" ControlToCompare="mycompositecontrol2"
Operator="GreaterThanEqual" Type="Date" Display="Dynamic" ErrorMessage="there is an error !"
Text="!"  ValidationGroup="myValidationGroup" />

It works great !

so I do exactly the same operation in the InserItemTemplate (It's a copy/paste)

but this time, it doesn't work, I have no error message in my validationsummary and near my control to validate!

If you know that problem, help me please

thanks in advance

A: 

This isn't really a good answer to the question directly, but:

I have never had any good luck with the baked in ASP validators. I always try to hammer their square peg into a round hole for a while, get close, get frustrated, then roll my own with my own logic, error messages in labels, and switching visibility with a CSS style.

P.S. when you copy pasted your validator, make sure you changed what control it is validating...

Andy_Vulhop
thanks for your answer, but I can't use my own logic, I have to use asp.net validators.I use asp validators everywhere in my application with no problem. the only one that I encounter is with listview's insertitemtemplate and my compositecontrolthe ControlToValidate property is well setted, that's not the problem
Sam