I have an Invoice Model which has an areaId property:
public class Invoice : IEntity, IValidatableObject
{
...
[Required(ErrorMessage = "Region is a required field.")]
[Display(Name = "Region:")]
[Remote("Check","Invoice")]
public virtual int? AreaId { get; set; }
...
So, I'm trying to get the remote validation working on AreaId.
In my invoice controller I set up:
public void Check(int id)
{
}
which I expected would get hit when I did an insert for an Invoice as it would try to validate.
Nothing happened when I validated.
I checked fiddler and it had an HTTP 500 error trying to get to /Invoice/Check/Invoice.AreaId=1
It never got to my check method. I did however manually type in the URL Invoice/Check/1 and it got there alright.
Anyone know what I'm doing wrong? It's like it's constructing the Url all wrong.