3
How can I do a preloader(carrying...) while it is rendering the view on @RenderBody
?
In search only found examples using Partial, but Views not
Any idea?
3
How can I do a preloader(carrying...) while it is rendering the view on @RenderBody
?
In search only found examples using Partial, but Views not
Any idea?
1
It’s not much of a secret:
public JsonResult MinhaAction(int id)
{
// Preenchimento de 'meuJson', e tal
return Json(meuJson);
}
I’m using jQuery, and supposing you’ve already found a "loading" screen somewhere. I’m going to assume that it sits inside a <div>
whose id is "loading":
$('#meuLink').click(function()
{
var action = '@Html.ResolveUrl("~/MeuController/MinhaAction/")' + $('#campoId').val();
$('#carregando').show()
$.getJSON(action, null, function(variavelDeCallback)
{
// Faça aqui o que precisa com 'meuJson'
$('#carregando').hide()
});
});
Browser other questions tagged asp.net-mvc-5
You are not signed in. Login or sign up in order to post.
There is a return Json gypsy, I wanted the whole page Return View()
– Rod
@Rod This is behavior done by Javascript. It depends on how your View is called. If it’s by Ajax, my answer will do. Otherwise, I don’t know if you can do it.
– Leonel Sanches da Silva
is called with same actionlink
– Rod
@Rod as the Gypsy spoke since the link is loaded by ajax has no problem being View or Partialview, of course being View, by default Layoutmaster will come along and you can give replace of everything (which I do not think good idea) or else in the view remove Layoutmaster!
– Trxplz0