Closed AlexBar closed 12 years ago
Hi,
I've implemented Remote validation support. Available methods:
Route based configuration: .Remote(c => c.For("routeName")); .Remote(c => c.For("routeName", new[] { "Id", "Id2" }));
Configuration via string-based methods: .Remote(c => c.For(controller, action)); .Remote(c => c.For(controller, action, areaName)); .Remote(c => c.For(controller, action, new[]{additionalFields})); .Remote(c => c.For(controller, action, new[] { additionalField1, additionalField2 })); .Remote(c => c.For(controller, action, areaName, new[] { additionalFields }));
Configuration via strong-typed methods: .Remote(c => c.For(a => a.CheckUsername2(null, null))); // additional fields will automatically parsed from controller action method .Remote(c => c.For(a => a.CheckUsername2(null, null), "area")); .Remote(c => c.For(a => a.CheckUsername2(null, null), new[] { additionalField1, additionalField2 })); .Remote(c => c.For(a => a.CheckUsername2(null, null), "area", new[] { additionalField1, additionalField2 })); Simplified version when no any additional fields needed: .Remote(c => c.For(x => x.CheckUsername1)); .Remote(c => c.For(x => x.CheckUsername1, areaName));
To set http method use: .Remote(c => c.HttpMethod(httpMethod).For(x => x.CheckUsername1));
Thanks
Alex, could you please update wiki with documentation how to use this?
Done: https://github.com/MvcExtensions/Core/wiki/Remote-validation
Cool, thanks
Hi,
I've implemented Remote validation support. Available methods:
Route based configuration: .Remote(c => c.For("routeName")); .Remote(c => c.For("routeName", new[] { "Id", "Id2" }));
Configuration via string-based methods: .Remote(c => c.For(controller, action)); .Remote(c => c.For(controller, action, areaName)); .Remote(c => c.For(controller, action, new[]{additionalFields})); .Remote(c => c.For(controller, action, new[] { additionalField1, additionalField2 })); .Remote(c => c.For(controller, action, areaName, new[] { additionalFields }));
Configuration via strong-typed methods: .Remote(c => c.For(a => a.CheckUsername2(null, null))); // additional fields will automatically parsed from controller action method
.Remote(c => c.For(a => a.CheckUsername2(null, null), "area"));
.Remote(c => c.For(a => a.CheckUsername2(null, null), new[] { additionalField1, additionalField2 }));
.Remote(c => c.For(a => a.CheckUsername2(null, null), "area", new[] { additionalField1, additionalField2 }));
Simplified version when no any additional fields needed:
.Remote(c => c.For(x => x.CheckUsername1));
.Remote(c => c.For(x => x.CheckUsername1, areaName));
To set http method use: .Remote(c => c.HttpMethod(httpMethod).For(x => x.CheckUsername1));