Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete 9 posts 150 karma points
    Mar 05, 2024 @ 13:53
    Pete
    0

    I have followed these instructions to create a login page using a macro:

    https://docs.umbraco.com/umbraco-cms/tutorials/members-registration-and-login

    The form appears on the page ok, but if the user submits wrong details, it just refreshes the page. Is there any way I can display an error message to let the user know if they have entered a wrong username or password?

    I have checked the tempdata and viewdata passed back to the macro view but neither of them seem to contain any error details

  • Pete 9 posts 150 karma points
    Mar 05, 2024 @ 14:26
    Pete
    101

    I had to change the mode of the asp validation summary to All:

                <div asp-validation-summary="All" class="form__validation"></div>
    

    If I only wanted the login errors to show in the summary and not the model errors (ie only when a user name and password were submitted and incorrect), I had to replace the above with

                @Html.ValidationMessage("loginModel", new { @class = "form__validation" })
    
Please Sign in or register to post replies

Write your reply to:

Draft