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

后端 未结 4 925
臣服心动
臣服心动 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条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 15:19

    I defined two functions in Site.Master:

        
    

    And special section:

        
    Loading...

    Visual style is defined in CSS:

    div#spinner
    {
        display: none;
        width:100px;
        height: 100px;
        position: fixed;
        top: 50%;
        left: 50%;
        background:url(spinner.gif) no-repeat center #fff;
        text-align:center;
        padding:10px;
        font:normal 16px Tahoma, Geneva, sans-serif;
        border:1px solid #666;
        margin-left: -50px;
        margin-top: -50px;
        z-index:2;
        overflow: auto;
    }
    

提交回复
热议问题