title: Insert data through a viewgrid after clicking on CREATE (more than one viewgrid)
body: <p>I'm stuck on this situation and i dont understand how to make it works on MVC ASP.NET Core using C#</p>
  <p>I created a viewgrid that allows me to Create, Update, Delete every single row shown in the grid. The problem is that everytime i click on CREATE it shows me a page where i can only write (manually) everything but instead of that i want my application to display another viewgrid (from a different database table) and allow the user to select the ROW or ROWS that he wants to add (something like a checkbox or whatever).</p>
  <p>Take a look:</p>
  <p><a href="https://i.stack.imgur.com/onnW1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/onnW1.jpg" alt="image" /></a></p>
  <p>How can i do that?. I searched a lot but nothing really helped at all. Found something related to FORMS but not sure about that</p>
  <p><strong>This is my CONTEXT cs file:</strong></p>
  <pre><code>public void CreateUser (User user)
  {
      using (SqlConnection con = new SqlConnection(connectionString))
      {
          SqlCommand cmd = new SqlCommand(&quot;Create_user&quot;, con)
          {
              CommandType = System.Data.CommandType.StoredProcedure
          };
  
          cmd.Parameters.AddWithValue(&quot;@NAME&quot;, user.NAME);
          cmd.Parameters.AddWithValue(&quot;@LAST&quot;, user.LAST);
          cmd.Parameters.AddWithValue(&quot;@DESCRIPTION&quot;, user.DESCRIPTION);
  
          con.Open();
          cmd.ExecuteNonQuery();
          con.Close();
      }
  
  }
  </code></pre>
  <hr />
  <p><strong>This is my Controller file:</strong></p>
  <pre><code>[HttpPost]
     [ValidateAntiForgeryToken]
  public ActionResult Create(int id, [Bind] User user)
  {
      try
      {
          if (ModelState.IsValid)
          {
              dbContext.UpdateAprobador(user);
              return RedirectToAction(&quot;Index&quot;);
          }
  
          return View(dbContext);
      }
      catch
      {
          return View();
      }
  }
  </code></pre>
  <hr />
  <p><strong>This is my VIEW file:</strong></p>
  <pre><code>@model WebApplicationNewsan.Models.User
  
  @{
      ViewData[&quot;Title&quot;] = &quot;Create&quot;;
  }
  
  &lt;h1&gt;Create&lt;/h1&gt;
  
  &lt;h4&gt;User&lt;/h4&gt;
  &lt;hr /&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-md-4&quot;&gt;
          &lt;form asp-action=&quot;Create&quot;&gt;
              &lt;div asp-validation-summary=&quot;ModelOnly&quot; class=&quot;text-danger&quot;&gt;&lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;label asp-for=&quot;NAME&quot; class=&quot;control-label&quot;&gt;&lt;/label&gt;
                  &lt;input asp-for=&quot;NAME&quot; class=&quot;form-control&quot; /&gt;
                  &lt;span asp-validation-for=&quot;NAME&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;label asp-for=&quot;LAST&quot; class=&quot;control-label&quot;&gt;&lt;/label&gt;
                  &lt;input asp-for=&quot;LAST&quot; class=&quot;form-control&quot; /&gt;
                  &lt;span asp-validation-for=&quot;LAST&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;label asp-for=&quot;DESCRIPTION&quot; class=&quot;control-label&quot;&gt;&lt;/label&gt;
                  &lt;input asp-for=&quot;DESCRIPTION&quot; class=&quot;form-control&quot; /&gt;
                  &lt;span asp-validation-for=&quot;DESCRIPTION&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;input type=&quot;submit&quot; value=&quot;Create&quot; class=&quot;btn btn-primary&quot; /&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;a asp-action=&quot;Index&quot;&gt;Back to List&lt;/a&gt;
  &lt;/div&gt;
  
  @section Scripts {
      @{await Html.RenderPartialAsync(&quot;_ValidationScriptsPartial&quot;);}
  }
  </code></pre>