c# - Select list population based off of other select list -


i'm in bit of pickle rick , need help. below code select lists in form. need certification list populate based off of category pick category list. how work?

code:

// get: int_certificationsxref/create public iactionresult create() {     viewbag.fullname = userinformation.globals.fullname;     viewdata["int_certificationcategoriesid"] = new selectlist(_context.int_certificationcategories, "id", "category");     viewdata["int_certificationconferredid"] = new selectlist(_context.int_certificationconferred, "id", "conferredby");     viewdata["int_certificationsid"] = new selectlist(_context.int_certifications, "id", "certification").where(i => i.categoryid = viewdata["int_certificationcategoriesid"]);     viewdata["rim_resourceid"] = new selectlist(_context.rim_resource, "id", "firstname");     return view(); } 

you can filter list list b using function contains

viewdata["int_certificationcategoriesid"] = new selectlist(_context.int_certificationcategories, "id", "category");     viewdata["int_certificationconferredid"] = new selectlist(_context.int_certificationconferred, "id", "conferredby");     viewdata["int_certificationsid"] = new selectlist(_context.int_certifications, "id", "certification").where(i => i.categoryid.contains(_context.int_certificationcategories.id));     viewdata["rim_resourceid"] = new selectlist(_context.rim_resource, "id", "firstname"); 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -