Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 2 dropdownlist one has 2 item and another is 3 item.i want to disabled 0ne item from 2 dropdown on 1st droppdown changed. please help me.?i am using mvc with razor.
Posted

1 solution

you need to put some logic by comparing drop down items
you can use following some thin then code is not exact
C#
var vList = new modelname().List()
                .Select(s => new SelectListItemExtends()
                {
                    Text = s.name,
                    Value = s.id,
                    Enabled = true/false
                }).ToArray();/ tolist()

        @Html.DropDownList("id", vList as IEnumerable<SelectListItemExtends>, new { })
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900