How to add accessible name ( aria-label ) in @DropDownListFor in razor?

OneWorld 0 Reputation points
2024-03-18T17:56:37.2133333+00:00

I have filter dropdown and trying to add comply with 508 compliance. I used aria_label, aria-label and aria_labelledby but unable to see accessible name for the DropDownListFor. I see No ARIA attributes under ARIA Attributes on Chrome Browse tool. How can I add accessible name for DropDownListFor (see snippet below) ?

<div class="col-md-3">
@Html.LabelFor(model => model.AccountID) <span style="color: red;">*</span>
@Html.DropDownListFor(m => m.AccountID, this.ViewBag.AccountList SelectList, new { id = "AccountList", multiple = "true" , @class = "selectSearchAccount show-tick form-control", aria_Label: "Select Account"})
Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | ASP.NET | Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.