c# - CRUD Operations on Grandchild using MVC -


this first question on community, hope can help.

i have 3 models: parent, child , grandchild. resource, parameter , metric. create controlers entity framework , generated crud operations. problem grandchild. when go create new metric (grandchild), have dropdownlist of parameters (child), want first choose resource, list parameters resource can create metric. i'm new on asp mvc , might lil bit basic question couldn't find this.

here classes in case.

public class resource {          public int resourceid { get; set; }     public string name { get; set; }     public virtual icollection<parameter> parameters { get; set; } }  public class parameter {     public int parameterid { get; set; }     public string name { get; set; }      public int resourceid { get; set; }     public virtual resource resource { get; set; }     public virtual icollection<metric> metrics { get; set; } }  public class metric {     public int metricid { get; set; }     public string name { get; set; }      public int parameterid { get; set; }     public virtual parameter parameter { get; set; } } 

what trying sounds either linked or cascading drop down list. did quick search , found link may you.

you need javascript listens selection changed event first list (parent), , updates second list (child) available values. depending on situation, may need link third list (grandchild) load when second list has selection changed well.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -