Hi. I have a problem with registering user via restful service.
I have web api project with individual user account authentication chosen.
While i am registering new user via my rest request which is following, , in response i am not getting any message like error message or success message.
HttpRequest request = new HttpRequest(); // create a new XHR // add an event handler that is called when the request finishes request.onReadyStateChange.listen((_) { if (request.readyState == HttpRequest.DONE && (request.status == 200 || request.status == 0)) { // data saved OK. //print(request.responseText); // output the response from the server this.registerMessage='login ok';//request.responseText; } }); // POST the data to the server var url = "http://localhost:3120/api/Account/Register"; request.open("POST", url, async: false); request.setRequestHeader("Content-Type", "application/json"); // var register=new JsonObject(); var mapData = new Map(); mapData["Email"] = this.Email; mapData["Password"] = this.Password; mapData["ConfirmPassword"]=this.ConfirmPassword; String jsonData = JSON.encode(mapData); // convert map to String request.send(jsonData);
There is only http code information.
In AccountBindingModels I saw
public class RegisterBindingModel { [Required] [Display(Name = "Email")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } }
Why model validation messages are not send to my client side application?