How to bind ArrayList to DropdownList in Asp.Net?


#1

Hi friends, I am a learner of Asp.Net & want to learn binding ArrayList to DropdownList in Asp.NeT. Its my first so post hoping great support & suggestions.


#2

It’s not clear from the question whether you use WebForms or ASP.NET MVC, you may want to specify the UI framework you use.


#3

eyalsk i will use ASP.NET MVC


#4
 <select name="dowList" id="dowList">
    @{string[] weekRagne = new string[] { "Sun", "Mon", "Tues", "Wed" };}
    @foreach (var week in weekRagne)
    {
        <option value="@week">@week</option>
    }
</select>

.NET Foundation Website | Blog | Projects | Code of Conduct