Saturday, 31 August 2013

how can pass a model to some partial view

how can pass a model to some partial view

i have a page that contains 3 partial views.
...
.
.
@Html.Action("one" , "Home")
@Html.Action("two" , "Home")
@Html.Action("three" , "Home")
.
.
.
i have 5 table in data base.and some of them have relation.some fields of
these table should be filled in partial ONE,some should be filled in
partial TWO,and ... i make a class of combination this 5 table.
public class ViewModelX
{
public Nullable<long> id_sport { get; set; }
public Nullable<long> id_city { get; set; }
public Nullable<long> id_spend { get; set; }
public Nullable<long> id_profile { get; set; }
public Nullable<int> cost { get; set; }
public Nullable<long> idFactor { get; set; }
public Nullable<long> Idpage { get; set; }
public string username { get; set; }
public string Namestar { get; set; }
public string Lnamestar { get; set; }
public string Tell { get; set; }
public string cell { get; set; }
public string Address { get; set; }
public string Code { get; set; }
public string username_s { get; set; }
public Nullable<long> id_s { get; set; }
public Nullable<long> id_mark{ get; set; }
}
now i should pass this model to every partial? and i should pass it to my
basic page that contains this 3 partial views too?

No comments:

Post a Comment