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"})
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,204 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
{count} votes