ASP.NET Standard Login Form - (aria-valid-attr-value) Issue RRS feed

  • Question

  • User140361571 posted

    Can anyone assist me in next steps to resolve the issue below?

    I am debugging the stock ASP.NET Login Form in VS Studio 2019

    On the Razor Email Field (in the Login.cshtml file)
            @Html.TextBoxFor(m => m.Email, new { @class = "form-control" })

    I keep getting a red-squiggly in VS Studio - on the View (Login.cshtml).  
    It shows an aria-valid-attr-value issue.  

    I have inspected the Email field in Chrome - All ARIA attribute values in this field appear to be valid:

    <input class="form-control valid" data-val="true" 
    data-val-email="The Email field is not a valid e-mail address." 
    data-val-required="The Email field is required." 
    id="Email" name="Email" type="text" value="" 
    aria-describedby="Email-error" aria-invalid="false">
    Sunday, December 6, 2020 7:42 PM

All replies

  • User1535942433 posted

    Hi papadan1066,

    Accroding to your description,as far as I think,Invalid ARIA attribute value: aria-describedby="Email-error".The format is wrong.

    More details,you could refer to below article:


    Best regards,

    Yijing Sun

    Monday, December 7, 2020 8:34 AM
  • User140361571 posted

    I appreciate the link and it provides a lot of helpful info on aria-describedby, however:

    I could not see where "Email-error" was an incorrect format.  Or why.  Or why it was even created by the ASP.NET engine to start with.

    I typed in an invalid email to check and see if there was an error message with the id="Email-error" and there was, so I'm not sure what you mean by incorrect format?

    Do you have any feedback on this?  I'm still researching and hope to find it myself, but anything "more-specific" regarding my comments above would be very helpful.  Thanks in advance!

    Monday, December 7, 2020 9:41 PM
  • User1535942433 posted

    Hi papadan1066,

    Accroding to your description,I don't understand your reqiurment clearly.What's the details of the " aria-valid-attr-value issue. "?

    Could you tell more details to us?It will help us to solve your problems.

    Best regards,

    Yijing Sun

    Thursday, December 10, 2020 9:25 AM
  • User140361571 posted

    Thanks for the reply, yig sun:

    The requirement is that I want the error message I'm getting in VS 2019 to go away.  It's coming from a standard login form that is generated in the .NET framework MVC (ASP).  I did not code the aria attributes on the field, they were auto generated by VS Studio 2019 and the .NET MVC Framework.  As for more specifics, not sure what to provide.  I've already provided the error and where it occurs.  And for additional info, I've provided what the field looks like in markup after generating the aria attributes.  As even more info, I've provided my research finding on the two aria attributes that could have caused the error.  I found nothing out of sorts.  One person suggested that the formatting of the aria-describedby might be invalid.  I researched it and did not find anything wrong with the value of "Email-error".  This is an id of the field that generates if someone puts in an invalid email address.  And when I did that, the id was valid.

    What else do you require?  Thanks in advance.

    Friday, December 11, 2020 8:36 PM
  • User409696431 posted

    Are  you saying the form works as expected and the only thing you are trying to address is VS's squiggly line error?

    If so, ignore VS's error.

    (I can't reproduce your error without knowing more about what kind of project you are using.  The Login form created by VS on my MVC projects doesn't include the aria markup you see.)

    Saturday, December 12, 2020 1:23 AM
  • User140361571 posted

    Yes, I am saying exactly that.  I have been ignoring the error, but it would be easier if I knew that it was some kind of known bug.

    I'm using .NET framework 4.804084  Visual Studio Community 2019.  I have not touched the Login.cshtml file, but have made coding changes regarding authentication and such.  But not sure how that would affect the login form.  I can't see how any of my changes would prompt .NET to place aria attributes on fields.  I have a feeling that all of that is auto-generated out of the box.  Which unnerves me because no one else anywhere else seems to get this error.  Perhaps it was a bug in .NET and fixed in Core.  I don't know.  But if it was a bug, my google searches are coming up empty.

    Saturday, December 12, 2020 9:13 PM
  • User409696431 posted

    Ask on the Visual Studio forum:


    Saturday, December 12, 2020 9:57 PM