Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

adding id tag to mvc dropdownlist

I'm using MVC 5 in a ASP.NET MVC application.

In my view I'm called my model like this at the beginning of the page.

@model Northwind.Models.EmployeeModel

Then on my page I have a dropdown list that looks like this:

@Html.DropDownList("LastName")

When I run my page it works fine.

So here's my question.

When I use a html dropdownlist the typical tag looks like this:

<input id="DDLLastName" type="text" class="DDLLastNameStyle"  />


How do i add id tag called the following id="DDLLastName"  to my which mvc dropdownlist which currently looks like this?:

@Html.DropDownList("LastName")
ASKER CERTIFIED SOLUTION
Avatar of Lokesh B R
Lokesh B R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial