ASP.NET AJAX UpdateProgress Control Example with UpdatePanel

Home » Uncategorized » ASP.NET AJAX UpdateProgress Control Example with UpdatePanel
Uncategorized No Comments

ASP.NET AJAX UpdateProgress Control Example with UpdatePanel

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(2000);

    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 638px;
            height: 256px;
        }
        .auto-style2 {
            width: 48%;
            height: 256px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        <div>
            <table style="height: 300px; width: 400px" border="1">
                <tr>
                    <td valign="top" class="auto-style2">

                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>

                                <asp:Button ID="btnSubmit" runat="server" Text="Submit"
                                    OnClick="btnSubmit_Click" />
                                <br />
                                <br />

                            </ContentTemplate>
                        </asp:UpdatePanel>

                        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                            <ProgressTemplate>
                                <img src="ajax-loader.gif" alt="Ajax " />Loading...
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                    <td class="auto-style1">Facebook CEO Mark Zuckerberg had given a Q&A in Mandarin Chinese, and two years later, he puts out his first Facebook video with daughter Maxima and wife Priscilla wishing everyone for the Lunar New Year in Mandarin Chinese.
                    </td>
                </tr>


            </table>
        </div>
    </form>
</body>
</html>

Output screenshot:-

 

 

LEAVE A COMMENT