I'm writing a very simple POC app that uses LLBL objects which are consumed by a WinForm and Web version.
The WinForm (DeveloperExpress) correctly consumes the IDataError published in this code on the entity.
protected override bool OnValidateFieldValue(int fieldIndex, object value)
{
bool toReturn = true;
switch ((CustomerFieldIndex)fieldIndex)
{
case CustomerFieldIndex.Country:
if (value.ToString() != "USA" && this.User != null && this.User.Country == "USA")
{
SetEntityFieldError(CustomerFields.Country.Name, "USA users can only set country to USA", true);
toReturn = false;
}
else
{
SetEntityFieldError(CustomerFields.Country.Name, string.Empty, false);
}
break;
default:
toReturn = true;
break;
}
return toReturn;
}
In a general sense, how is this done on the web, does ASP.NET consume the IDataError info that SetEntityFieldError() publishes?