Hello, we are trying to localize the deafult messages from data annotation validation attributes on the client side. Using Blazorise validation works, but we've opted to use Blazor form elements. Is it possible to make localization work in that context? Basic example:
Component.razor:
<EditForm Model="model" OnValidSubmit="SubmitAsync">
<DataAnnotationsValidator />
<InputText id="name" @bind-Value="model.Test" />
<ValidationMessage For="() => model.Test" />
<Button Type="ButtonType.Submit">Button</Button>
</EditForm>
Model DTO:
public class TestDto
{
[Required(ErrorMessage = "Required1"]
public string Test { get; set; }
}
We've added key-value pair in en.json: "Required1": "test test {0}"
Thank you in advance
Hi,
I have couple of questions regarding the abp commercial identity module extensibility:
user.AddOrUpdateProperty<string>(
"Surname",
property =>
{
property.UI.OnTable.IsVisible = false;
}
);
How to set new property as required in database?
How to enable client side validation for the property? We've set required attribute with the following:
property.Attributes.Add(new RequiredAttribute());
But only server side validation works (modal window pops up if field is empty) - is it possible to enable client side validation for new properties?
Same goes for field length. We have set the following in ModuleExtensionConfigurator:
property.Attributes.Add(new MaxLengthAttribute(UserConsts.MaxTitleLength));
But only the server side validation is triggered.
Thank you in advance, Hrvoje