jquery - Remote validation with SimpleMembership in MVC4 - Doesnt hit controller method -


i trying use remote validation on username proerty, on register page, user gets notice if user name taken. worked before added simplemembership stuff.

after adding simlplemembership, stopped working, returned error, simplemembership tables not having pks. researched , found built-in way remote validation.

now no errors, , can see in network tab of google developer tools, ajax call being made correct controller, put breakpoint in controller method, , not hit. not sure do. here how setup:

the model remote attribute attached.:

    [required]     [remote("verifyuserexists", "account")]     [display(name = "user name")]     public string username { get; set; } 

the controller method thats not hit:

    public jsonresult verifyuserexists(string username)     {         var user = membership.getuser(username);          if (user != null)         {             return json(errorcodetostring(membershipcreatestatus.duplicateusername),                             jsonrequestbehavior.allowget);         }         else         {             return json(true, jsonrequestbehavior.allowget);         }      } 

and validation enabled in web config;

<add key="clientvalidationenabled" value="true" /> <add key="unobtrusivejavascriptenabled" value="true" /> 

any ideas missing? again, worked before added in simplemembership stuff.

check http status code being returned in response. if cannot tell status code google tools use fiddler. if status code 302 server sending redirect, occurs when there server error. check server logs see if there errors determine issue is.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -