Buenos Dias.
Por favor si me pueden ayudar sobre el modo modal.
Este es mi código en la vista del índice de mi tabla
@model IEnumerable<RecordGeneral.Models.TABTRegp>
@{
ViewBag.Title = "Index";
}
<h2><span class="nuevo_lb">REGIMEN</span></h2>
<p>
<a href="#" class="btn btn-info btn-sm btnCreate" >Adicionar</a>
</p>
<table class="table table-responsive table-striped nuevo_tr">
<tr>
<th>
@Html.DisplayNameFor(model => model.RGPCodi)
</th>
<th>
@Html.DisplayNameFor(model => model.RGPDesc)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.RGPCodi)
</td>
<td>
@Html.DisplayFor(modelItem => item.RGPDesc)
</td>
<td>
<a href="#" class="btn btn-info btn-sm btnEdit" data-value="@item.RegpID">Modificar</a>
@Html.ActionLink("Eliminar ", "Delete", new { id = item.RegpID }, new { @class = "btn btn-info btn-sm" })
</td>
</tr>
}
</table>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div id="ContenedorModal"></div>
</div>
</div>
</div>
</div>
@section scripts{
<script type="text/javascript">
$(document).ready(function () {
$(".btnEdit").click(function () {
var id = $(this).data("value");
$("#ContenedorModal").load("/TABRegp/Edit/" + id, function () {
$("#myModal").modal("show")
});
});
});
$(document).ready(function () {
$(".btnCreate").click(function () {
$("#ContenedorModal").load("/TABRegp/Create/", function () {
$("#myModal").modal("show")
});
});
});
</script>
}
este es la imagen


al dar click al botón crear debería quedar la misma pantalla para seguir ingresando. pero me sale la siguiente pantalla.
este es mi código del controlador y la imagen respectiva.
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using RecordGeneral.Models;
namespace RecordGeneral.Controllers
{
public class TABRegpController : Controller
{
private RecordGeneralContext db = new RecordGeneralContext();
// GET: /TABRegp/
public ActionResult Index()
{
return View(db.TABTRegps.ToList());
}
// GET: /TABRegp/Create
public ActionResult Create()
{
return PartialView();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include="RegpID,RGPCodi,RGPDesc,CreatedBy,DateCreated,UpdatedBy,DateUpdated")] TABTRegp tabtregp)
{
if (ModelState.IsValid)
{
db.TABTRegps.Add(tabtregp);
db.SaveChanges();
return RedirectToAction("Create");
}
return PartialView(tabtregp);
}
