Asp.net MVC4 Multiple Models 1 View -


so im writing application has upload area images..

what dynamicallyi build path files uploaded.

the user select client,market,project , place ( of these seperate models )

i build view showed clients( dropdown), market (dropdown) , on can grab values place them on server under directory in name...

i not know how combine models them single view, other creating partial view every dropdown menu ( right way handle ? )

can help? - thanks

edits :

here thinking ment throw razor view ( givin pass of them somehow )

@model oilngasweb.models.userprofiles @model oilngasweb.models.userinfo @model oilngasweb.models.userdata @model oilngasweb.models.users 

then code beneath ... thats ment hierarchie?


what thinking include ienumerable<> in model of main model users

user model

[table("users")] public class userprofiles {     [key]     [databasegeneratedattribute(databasegeneratedoption.identity)]      public int userid { get; set; }      public string username { get; set; }      public virtual icollection<userroles> usersroless { get; set; }     public virtual icollection<userinfo> usersinfos { get; set; }     public virtual icollection<userdata> usersdatas { get; set; }     public virtual icollection<users> userss { get; set; } 

then partial views each in index view of users...

trying think of better concept ( if there 1 ) sorry making question unclear

you can't have many models that, can do:

public class rootmodel {   public ienumerable<userprofile> profiles { get; set; }    public userinfo user { get; set; }    public ienumerable<user> users { get; set; }    .   . } 

and pass complex view. can pass data partial views supplying model property of html.partial("x", model) form of method.


Comments