overload methods in validation.xml

Mar 13, 2008 at 3:36 AM
Simon,

I got an AmbiguousMatchException from classType.GetMethod(methodData.Name) since I got an overload method.

if I haver thow methods, add(int i) and add(string s), how can I change my validation.xml file to make it work ?

thanks for your help,
Max
Coordinator
Mar 13, 2008 at 6:38 AM
Edited Mar 13, 2008 at 6:41 AM
Max
You can do this using the overloadType node.
Just list them in the same order as the parameters of each method.
For example
    <method name="Add">
      <overloadType typeName="System.Int32"/>
      <parameter name="i">
rules go here
      </parameter>
    </method>
    <method name="Add">
      <overloadType typeName="System.String"/>
      <parameter name="s">
rules go here
      </parameter>
    </method>

There is more detail on this in the "Adding Validation Rules Using Configuration" topic in the chm.

Regards

Simon
Mar 14, 2008 at 6:02 AM
Wow ~~~

It WORKS !!

thank you very much.
Coordinator
Mar 14, 2008 at 10:24 AM
You sound surprised :)