ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to bind 2 Odropdown when creating a record for a grid
Title:
B
I
{code}
?
I have an entity Phones which is displayed in a Grid. When I create a new record, I have to fill 2 fields: - Site - Free phone number The viewmodel for input is : [UIHint("Odropdown")] [AweUrl(Action = "GetSitesSQL", Controller = "Data")] public int SiteId { get; set; } [UIHint("Odropdown")] [AweUrl(Action = "GetSQLFreeTelephoneNumber", Controller = "Data")] public string LineURI { get; set; } In my create view, I have these 2 dropboxes. I would like to bind dynamically the Free phone number dropdown with Site dropdow. I mean, if I choose I site (for example Geneva), I would like that my dropdown box "Free phone number" display only phone number from Geneva, If I choose Zürich, it will only show Züriche phone numbers. So each time I change the selected value of my Site dropdown box, I have dynamically a new list of Free phone numbers in the other dropdown box. How can I do that ? Thanks
Save Changes
Cancel
Alain Rime
asked at 01 Mar 2016
http://demo.aspnetawesome.com/AjaxDropdownDemo#Cascading-dropdownlist-using-binding-to-parent there's also AwesomeParents attribute if you must use EditorFor, you can see it being used here: http://demo.aspnetawesome.com/AttributesDemo
at 01 Mar 2016
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK