Showing loading animation in center of page while making a call to Action method in ASP .NET MVC

后端 未结 4 931
臣服心动
臣服心动 2020-12-04 14:44

My application makes several calls to an Action method (ASP .NET MVC) which returns a Json object. When the application is waiting for this method to return its data I want

4条回答
  •  猫巷女王i
    2020-12-04 15:10

    This is how did it works like a charm.

    CSS

    #loader {
    position:fixed;
    left:1px;
    top:1px;
    width: 100%;
    height: 100%;
    z-index: 9999;
    
    background: url('../images/ajax-loader100X100.gif') 50% 50% no-repeat rgb(249,249,249);
    }  
    

    in _layout file inside body tag but outside the container div. Every time page loads it shows loading. Once page is loaded JS fadeout(second)



    JS at the bottom of _layout file


      
    

提交回复
热议问题