Вопрос

I have tow forms in a view.One for saving address and another is for updating them. I am using KendoUI dropdown helper for displaying countries and binding the same model for both the forms. In first form dropdown is working fine but in popup form dropdown not working. enter image description here first form

enter image description here Popup form

I am using the following way to bind data to dropdown list. enter image description here

If i change the name of second dropdown then its rendering correctly but i am unable to receive the selected value in controller as my viewmodel dosent have that name.

Can someone say where i am doing wrong?

Это было полезно?

Решение

This is likely because they are getting the same name/ID. You can try doing something like this:

@(Html.Kendo().DropDownListFor(m => m.Address.CountryRegionCode)
    .Name("country1")
    ...
)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top