I have a View Index and via the Create view is opened in modal form from it. When I open the modal Create, fill in the fields and click on the save button the modal remain open and the summary displays a msg at the top of the screen informing that the record has been registered. How do I, when I click the Modal Create button, the window is closed and the message (indicating that the record has been registered) is displayed at the top of the Index screen?
@model IEnumerable<Retaguarda.Application.ViewModels.PessoaSituacao.PessoaSituacaoViewModel>
@{
ViewData["Title"] = "Gerenciar Situações de Pessoa";
}
<div class="panel">
<div class="panel-heading">
<h2 class="panel-title">@ViewData["Title"]</h2>
<div class="page-header-actions">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a asp-action="Index" asp-controller="Home">Home</a></li>
<li class="breadcrumb-item active">pessoa-situacao-gerenciar/listar-todos</li>
</ol>
</div>
</div>
<div class="panel-body container-fluid">
<div class="row">
<div class="col-md-12">
<div>
<div class="float-left">
<div class="btn-group btn-group-sm"
role="group">
<a asp-action="Create" data-modal="" class="btn btn-success text-white" data-toggle="tooltip"
data-original-title="Nova Situação" data-container="body">
<i class="icon wb-plus" aria-hidden="true"></i>
<span class="hidden-xs">Nova Situação</span>
</a>
<a id="btnPesquisaAvancada" class="btn btn-dark text-white" data-toggle="tooltip"
data-original-title="Pesquisa Avançada" data-container="body">
<i class="icon wb-search" aria-hidden="true"></i>
<span class="hidden-xs">Pesquisa Avançada</span>
</a>
<div class="btn-group btn-group-sm" role="group">
<a data-original-title="Pesquisa Avançada" class="btn btn-dark text-white dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
<i class="icon wb-grid-4" aria-hidden="true"></i>
Mais Ações
</a>
<div class="dropdown-menu" aria-labelledby="exampleGroupDrop2" role="menu">
<a class="dropdown-item" href="javascript:void(0)" role="menuitem"><i class="icon wb-download" aria-hidden="true"></i>Importar</a>
<a class="dropdown-item" href="javascript:void(0)" role="menuitem"><i class="icon wb-upload" aria-hidden="true"></i>Exportar</a>
<a class="dropdown-item" href="javascript:void(0)" role="menuitem"><i class="icon wb-print" aria-hidden="true"></i>Imprimir</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div id="divPesquisaAvancada" class="busca">
<div class="panel bg-blue-grey-100">
<div class="panel-heading">
<h2 class="panel-title">Opções Avançadas de Pesquisa</h2>
</div>
<div class="panel-body container-fluid">
<div class="form-group">
<p>Não há Opções de Pesquisa.</p>
</div>
<div class="form-group">
<div class="pull-right">
<button id="btnPesquisar" class="btn btn-primary"><i class="icon wb-search"></i> Pesquisar </button>
<button id="btnFecharPesquisa" class="btn btn-danger"><i class="icon wb-close"></i> Fechar </button>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="panel panel-default">
<table id="dtPrincipal" class="table table-striped table-bordered center-header table-vcenter" cellspacing="0" width="100%">
<thead class="bg-blue-grey-100">
<tr>
<th>
ID
</th>
<th>
Descrição
</th>
<th>
Ações
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
<div class="modal fade modal-primary" id="modalGenerica" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog modal-dialog-centered" style="width: 800px; height: 500px;">
<div class="modal-content">
<div id="contentModal"></div>
</div>
</div>
</div>
<div class="modal fade" id="customerHistory" role="dialog">
<div class="modal-dialog modal-lg">
<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>
<h4 class="modal-title">Customer Data History</h4>
</div>
<div class="modal-body">
<p id="customerHistoryData"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@section scripts
{
<script src="~/js/cadastros/pessoaSituacao/pessoaSituacao.js"></script>
}