My view has 2 label 2 text-boxes and a button.

**This is my controller :**

```
public ActionResult Create()
{
    // Custom model that holds values
    // this is to set the default values to the text boxes

    return View(model);
}

[HttpPost]
public ActionResult Create(CustomModel viewModel )
{
    try
    {
        // TODO: Add insert logic here

        // The  button should trigger this method to   perform  update  

        return RedirectToAction("Create");
    }
    catch
    {
        return View();
    }
}

```

When I run the program it automatically goes to my model which contains no value and throws a null pointer exception. Any ideas on how to preserve the model state. ?

**Update :**

I am using classic ADO.Net Model not the entity framework. 

The `http get` and the `post method` follows a different logic. The Model with values are returned using the get method and the state of this model needs to be preserved for updating the corresponding records to the database using the post method. 

But, when I use the post method, the compiler automatically routes to my model class looking for a parameter less constructor. I believe it is creating a new instance of my model class.