Click here to Skip to main content
15,884,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
i have a main page that contains 3 partial views.i have a page that contains 3 partial views.

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.



//View Models:
C#
public class PartialViewModel1
{
    [Display(Name = "Name")]
    public String Name { get; set; }
   public String LName { get; set; }
    public String address { get; set; }
}

public class PartialViewModel2
{
    
    public int id { get; set; }
}

public class PartialViewModel3
{
    
    public DateTime DOB { get; set; }
}


//Controller Action Methods:


[HttpGet]
public PartialViewResult PartialView1()
{
    return PartialView(new PartialViewModel1());
}

[HttpGet]
public PartialViewResult PartialView2()
{
    return PartialView(new PartialViewModel2());
}

[HttpGet]
public PartialViewResult PartialView3()
{
    return PartialView(new PartialViewModel3());
}



 //Main view:


@Html.Action(PartialView1,Account)
@Html.Action(PartialView2, Account)
@Html.Action(PartialView3,Account)



i' ll pass
@model Practise.Controllers.PartialViewModel1
or
@model Practise.Controllers.PartialViewModel2
or
@model Practise.Controllers.PartialViewModel3
to my PartialViews.



i should pass any Models to my Main View(Main Page) ? and how can i send result of partial One to Two?
in fact i wanna fill three partialviews step by step .and send result of partial 1 to 2 . and end of partial 3, whole filled propertise should be send to my main page. please help
Posted
Updated 2-Sep-13 9:12am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900