0
After deleting and returning to index...
[HttpPost]
[ActionName("Delete")]
public ActionResult DeleteConfirmed(int id)
{
_unitOfWork.UserRepository.Remove(id);
_unitOfWork.Salva();
return RedirectToAction("Index");
}
My modal doesn’t go out..
Code btnDelete
<div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal">CANCELAR</button>
<input id="btnDelete" class="btn btn-danger" type="submit" value="EXCLUIR" />
</div>
How do I get it out automatically?
$('.fashion-footer'). close() ?
– Estácio Di Fabio
So, I had tried to do so, in the event click of the button but depending on the attribute I put it does not come out or the model nor appears.
– Jhonas
It worked that way. <script> $(Function () { $('#btnDelete').click(Function() { $('#myModal').modal('Hide'); }); }); </script>
– Jhonas
I put this script above but then didn’t update my view automatically, so I only changed the controller the Return Redirecttoaction("Index"); Por Return Json(new { Success = true }); E worked, I didn’t need the script, vlw..
– Jhonas
$( this ).dialog( "close" ); or something like that. I have a code that does this and works
– Estácio Di Fabio