The default behavior of a form within a ASP.NET Zero template is to disable the submit button until the form is valid. Since I have a rather large form with multiple tabs I enable the button always as its difficult for the user to figure out why the button might be disabled. Instead, I handle the error event of the service proxy and if there are any validation errors I explicitly highlight the tabs with invalid form data.
vm.save = function () {
vm.saving = true;
customerService.createOrUpdateCustomer(vm.customer).success(function () {
$uibModalInstance.close();
}).error(function (error) {
if (error.validationErrors && error.validationErrors.length > 0) {
// hightlight tabs with invalid form controls...
}
}).finally(function () {
vm.saving = false;
});
};
Unfortunately I would like to disable the default behavior of a service error in this case. By default, the templates behavior is to show a SweetAlert popup with the error message. How can I override this behavior for this special case?
Do you try to get the user infomation within a mvc controller or a service? Because both, the AbpServiceBase and the AbpController base class provide you with a property named CurrentSession that gives you access to the current user.
To me, the validation of DTOs seems like magic. Now, I was wondering how exactly the automatic validation of DTOs works behind the scenes?
When can the fix be expected? Since we are using the paid version as base for a real world customer project, which is already ongoing, I would be happy about a fix.
When I try to run the ASP.NET Zero Solution (download was in the end of last week) I get the following error:
Castle.Windsor Warning: 0 : Exception when resolving optional dependency Dependency 'FeatureValueStore' type 'Abp.Application.Features.IFeatureValueStore' on component Abp.Application.Features.FeatureChecker., Castle.MicroKernel.CircularDependencyException: Dependency cycle has been detected when trying to resolve component 'MyProject.Authorization.Users.UserManager'.
The resolution tree that resulted in the cycle is the following:
Component 'MyProject.Authorization.Users.UserManager' resolved as dependency of
component 'MyProject.MultiTenancy.Demo.TenantDemoDataBuilder' resolved as dependency of
component 'MyProject.MultiTenancy.TenantManager' resolved as dependency of
component 'MyProject.Editions.FeatureValueStore' resolved as dependency of
component 'Abp.Application.Features.FeatureChecker' resolved as dependency of
component 'Abp.Application.Features.FeatureDependencyContext' resolved as dependency of
component 'MyProject.Authorization.Users.UserManager' resolved as dependency of
component 'MyProject.Authorization.PermissionChecker' resolved as dependency of
component 'MyProject.Web.Controllers.HomeController' which is the root component being resolved.
So far I didn't change anything in the code. Except some workarounds for .NET 4.6 features since I am using Visual Studio 2013 with .NET 4.5.2. But I do not think, that this has anything to do with the dependency resolution problem. Looking forward to fix this problem.