This is Adish876's TypePad Profile.
Join TypePad and start following Adish876's activity
Adish876
Recent Activity
I had a problem with this validation provider when using Entity Framework Code First objects as MVC models. The problem was that in actions such as Create, the navigational properties for associated objects were null (as in Vehicle -> Driver; Driver was null when creating a Vehicle).
The problem was that the provider examined every property and returned validation errors on such properties. I modified the code to only validate the model and not the properties, like this:
public class EnterpriseLibraryValidationProvider : ModelValidatorProvider
{
public override IEnumerable<ModelValidator> GetValidators(
ModelMetadata metadata, ControllerContext context)
{
if (metadata.ContainerType == null || String.IsNullOrEmpty(metadata.PropertyName))
{
var validatorFactory = IocContainer.Instance.Unity.Resolve<ValidatorFactory>();
Validator validator = validatorFactory.CreateValidator(metadata.ModelType);
if (validator != null)
return new[] {
new EnterpriseLibraryValidationWrapper(metadata, context, validator)
};
}
return Enumerable.Empty<ModelValidator>();
}
}
Enterprise Library Validation example for ASP.NET MVC 2
This blog post is about a preview release of ASP.NET MVC 2. Details may change by the time the final release becomes available, so the code presented here may not necessarily work on future releases with slight modification. In ASP.NET MVC 2 Preview 1, we added support for server-side validation...
Mikekelly85 is right, you should have mentioned HTTP Digest.
Breaking the Web's Cookie Jar
The Firefox add-in Firesheep caused quite an uproar a few weeks ago, and justifiably so. Here's how it works: Connect to a public, unencrypted WiFi network. In other words, a WiFi network that doesn't require a password before you can connect to it. Install Firefox and the Firesheep add-in. W...
Adish876 is now following The Typepad Team
Nov 14, 2010
Subscribe to Adish876’s Recent Activity
