Inquiridor
MVC Bootstrap Modal

Pergunta
-
Todas as Respostas
-
Olá Minha duvida é a seguinte , tenho uma lista de registros e gostaria de saber como chamar um modal edit no MVC para atualizar o mesmo.
Muito obrigado.
Ola pessoal , estou próximo do objetivo, tirando a opção "hide" da classe da"div" aparece dessa forma:
Obrigado.
-
Galera venho insistir nesse post pois é urgente , fiz algumas alterações porem a tela modal não aparece: vou posta meu Código:
@model List<x.x.Dominio.Entidade.Lancamento>
@{
ViewBag.Title = "ListaLancamento";
}
<script src="~/Scripts/jquery-2.1.1.min.js"></script>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.DespesaId</td>
<td>@item.Cliente</td>
<td>@Html.ActionLink("Editar", "Editar", new { @id = item.DespesaId }, new { @class = "btnEdit btn btn-small btn-info" })</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="3">@Html.ActionLink("Adicionar", "Editar", null, null, new { @class = "btnEdit btn btn-small btn-info" })</td>
</tr>
</tfoot>
</table>
<div id='dialogDiv' class='modal hide fade in'>
<div id='dialogContent'></div>
</div>
@section scripts
{
<script type="text/javascript">
$(function() {
$.ajaxSetup({ cache: false });
$('.btnEdit').click(function() {
$('#dialogContent').load(this.href, function() {
$('#dialogDiv').modal({
backdrop: 'static',
keyboard: true
}, 'show');
bindForm(this);
});
return false;
});
});
function bindForm(dialog) {
$('form', dialog).submit(function() {
$.ajax({
url: this.action,
type: this.method,
data: $(this).serialize(),
success: function(result) {
if (result.success) {
$('#dialogDiv').modal('hide');
location.reload();
} else {
$('#dialogContent').html(result);
bindForm();
}
}
});
return false;
});
}
</script>
} -
-