How to implement Index and create in the same page on MVC 5?
<p>I am a beginner on <strong>MVC</strong> and I am trying to Create a web app where I want the user to be able to create new items and view them in the same page. 
I am trying to do this by using partial view for the Create Action inside the Index view.</p>

<p>The problem is I am not able to redirect from the child to the Index to update the list after creating new item. And I'm getting this error(<strong>Child actions are not allowed to perform redirect actions.</strong>)</p>

<p>Here is my model</p>

<pre><code> public class Expense
{
    public int Id { get; set; }

    [Required]
    public string Title { get; set; }

    [Required]
    [DataType(DataType.Currency)]
    public decimal Amount { get; set; }

    //[Required]
    public string ApplicationUserId { get; set; }
}
</code></pre>

<p>,here are my Index and Create Actions</p>

<pre><code>    public ActionResult Index()
    {
        return View(db.Expenses.ToList());
    }
    public ActionResult Create()
    {
        return PartialView("Create", new Expense());
        //return View();
    }

    // POST: /Expense/Create
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include="Id,Title,Amount,ApplicationUserId")] Expense expense)
    {
        if (ModelState.IsValid)
        {
            expense.ApplicationUserId = User.Identity.GetUserId();
            db.Expenses.Add(expense);
            db.SaveChanges();
            return RedirectToAction("Index"); // Here is where The exception is thrown
        }
        return View();
    }
</code></pre>

<p>And here is my Index view</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>@model IEnumerable&lt;HomeManager.Models.Expense&gt;
@{
    ViewBag.Title = "Index";
}
&lt;h2&gt;Index&lt;/h2&gt;
&lt;table class="table"&gt;
    &lt;tr&gt;
        &lt;th&gt;
            @Html.DisplayNameFor(model =&gt; model.Title)
        &lt;/th&gt;
        &lt;th&gt;
            @Html.DisplayNameFor(model =&gt; model.Amount)
        &lt;/th&gt;
        &lt;th&gt;&lt;/th&gt;
    &lt;/tr&gt;
    @foreach (var item in Model)
    {
        &lt;tr&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.Title)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.Amount)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })
            &lt;/td&gt;
        &lt;/tr&gt;
    }
&lt;/table&gt;
&lt;p&gt;
    @Html.ActionLink("Create New", "Create")
    @{Html.RenderAction("Create", "Expense");}
&lt;/p&gt;</code></pre>
</div>
</div>
</p>

<p>And here is my Create view </p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>@model HomeManager.Models.Expense

@{
    ViewBag.Title = "Create";
}

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


@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    &lt;div class="form-horizontal"&gt;
        &lt;h4&gt;Expense&lt;/h4&gt;
        &lt;hr /&gt;
        @Html.ValidationSummary(true)

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

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

        @*&lt;div class="form-group"&gt;
            @Html.LabelFor(model =&gt; model.ApplicationUserId, new { @class = "control-label col-md-2" })
            &lt;div class="col-md-10"&gt;
                @Html.EditorFor(model =&gt; model.ApplicationUserId)
                @Html.ValidationMessageFor(model =&gt; model.ApplicationUserId)
            &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;

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}</code></pre>
</div>
</div>
</p>