Question: I am developing MVC application.

I want to get entire object with its child collection when I click on submit button on the form. 

Please check below View Model.

I have below view model.

```
       public class AdviceCreateVM
        {      
            [Key]
            public int Id { get; set; }
            public string AdviceNo { get; set; }
            public  ICollection<InvoiceVM> Invoices { get; set; }
         }

   public class InvoiceVM
    {
        [Key]
        public int Id { get; set; }
        public string InvoiceNumber { get; set; }
        public double TotalAmount { get; set; }
    }

```

Now, I have method create of Paymentadvice controller which accepts the input from view. 

```
    [HttpPost]
    public ActionResult Create(AdviceCreateVM AdviceCreateVM,InvoiceVM invoiceVM)
    {
    }

```

in above menthod, I get the values of Invoice collection in the form of array.

but I have req. that, I should get the Advice create and the Invoice collection only in single object. like below method.

```
    [HttpPost]
    public ActionResult Create(AdviceCreateVM AdviceCreateVM)
    {
    }

```

How to get that ?

Answer: 
You can use:

```
Parent.FindControl("control_name") as Control_Type

```

For example:

```
HiddenField hdn = Parent.FindControl("hdn") as HiddenField;

```
You can create single ViewModel and add these two classes to that model as its fields

```
public class YourViewModel
    {
       public YourViewModel()
       {
        this.adviceCreateVM = new AdviceCreateVM ();
        this.invoiceVM = new InvoiceVM();
       }

       public AdviceCreateVM adviceCreateVM { get; set; }
       public InvoiceVM  invoiceVM { get; set; }
    }

```

Pass this model to view and return it as

```
[HttpPost]
public ActionResult Create(YourViewModel model)
{
//access both classes as model.adviceCreateVM and model.invoiceVM
}

```