I have two problems when submitting from my Ajax login form.
First problem is when i submit the login form without with the correct credentials all works fine, but if I input incorrect details there is any exception when trying to get the current pages id. (The form is a partial view)
The other problem, is again when I input incorrect information, I would like it to return the reason why the user could not log in. For example no account exists with the specified email. But no messages are rendered on the screen when returning the partial. (hits the errors messages fine when debugging)
Can anyone suggest or see what I am doing wrong in with these two issues? Any help in resolving this matter would be very much appreciated.
Because you are using an ajaxform, you need to return a failure and process the result using an onfailure function, returning a view won't work the way you are expecting.
Submitting From Ajax Form
I have two problems when submitting from my Ajax login form.
First problem is when i submit the login form without with the correct credentials all works fine, but if I input incorrect details there is any exception when trying to get the current pages id. (The form is a partial view)
The other problem, is again when I input incorrect information, I would like it to return the reason why the user could not log in. For example no account exists with the specified email. But no messages are rendered on the screen when returning the partial. (hits the errors messages fine when debugging)
Can anyone suggest or see what I am doing wrong in with these two issues? Any help in resolving this matter would be very much appreciated.
Umbraco version: 8.6.1
Here is my view/controller code:
View
Controller (Surface Controller)
Because you are using an ajaxform, you need to return a failure and process the result using an onfailure function, returning a view won't work the way you are expecting.
is working on a reply...