How to Bind ViewModel's object with the controller
<p>In my MVC application, I have a model class like below</p>

<pre><code>public class PROJECT
{
    [Display(Name = "Project No.")]
    public string PROJECT_NO { get; set; }

    [Display(Name = "Title")]
    [DataType(DataType.MultilineText)]
    [Required]
    public string TITLE { get; set; }

    [Display(Name = "Description")]
    [DataType(DataType.MultilineText)]
    public string DESCRIPTION { get; set; }

    [Display(Name = "Remarks")]
    public string REMARKS { get; set; }
}
</code></pre>

<p>And I have a ViewModel like this</p>

<pre><code>public class ProjectViewModel
{
    public PROJECT Project { get; set; }

    public bool IsSelected { get; set; }

    public COMPANY Companies { get; set; }

    public CLIENT Clients { get; set; }
}
</code></pre>

<p>The ViewModel is the one I am creating the controller and views for. I have created the Index, Details, Delete and Create Views as well. Index, Details and Delete Views just work fine but Create controller model binding does not seem to be working. The ProjectViewModel object that comes in as input to the controller Create is null. How do I bind the ViewModel as a parameter to this object?</p>

<pre><code>    // POST: /Project/Create
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create(ProjectViewModel project)
    {
        if (ModelState.IsValid)
        {
            db.PROJECTs.Add(project.Project);
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        ViewBag.CLIENT_ID = new SelectList(db.CLIENTs, "ID", "NAME", project.Project.CLIENT_ID);
        ViewBag.COMPANY_ID = new SelectList(db.COMPANies, "ID", "NAME", project.Project.COMPANY_ID);
        return View(project);
    }
</code></pre>

<p>And here is the Create View</p>

<pre><code>@model IMCCBluePrints.Models.ProjectViewModel

@{
    ViewBag.Title = "Create";
 }

 &lt;h2&gt;Create&lt;/h2&gt;

@using (Html.BeginForm()) 
{
@Html.AntiForgeryToken()

&lt;div class="form-horizontal"&gt;
    &lt;h4&gt;PROJECT&lt;/h4&gt;
    &lt;hr /&gt;
    @Html.ValidationSummary(true)

    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.PROJECT_NO, new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.EditorFor(model =&gt; model.Project.PROJECT_NO)
            @Html.ValidationMessageFor(model =&gt; model.Project.PROJECT_NO)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.TITLE, new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.EditorFor(model =&gt; model.Project.TITLE)
            @Html.ValidationMessageFor(model =&gt; model.Project.TITLE)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.DESCRIPTION, new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.EditorFor(model =&gt; model.Project.DESCRIPTION)
            @Html.ValidationMessageFor(model =&gt; model.Project.DESCRIPTION)
        &lt;/div&gt;
    &lt;/div&gt;




    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.REMARKS, new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.EditorFor(model =&gt; model.Project.REMARKS)
            @Html.ValidationMessageFor(model =&gt; model.Project.REMARKS)
        &lt;/div&gt;
    &lt;/div&gt;



    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.COMPANY_ID, "COMPANY_ID", new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.DropDownList("COMPANY_ID", String.Empty)
            @Html.ValidationMessageFor(model =&gt; model.Project.COMPANY_ID)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.Project.CLIENT_ID, "CLIENT_ID", new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.DropDownList("CLIENT_ID", String.Empty)
            @Html.ValidationMessageFor(model =&gt; model.Project.CLIENT_ID)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="form-group"&gt;
        &lt;div class="col-md-offset-2 col-md-10"&gt;
            &lt;input type="submit" value="Create" class="btn btn-default" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
}

&lt;div&gt;
    @Html.ActionLink("Back to List", "Index")
&lt;/div&gt;
</code></pre>