블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Category

Recent Post

Recent Comment

Archive

2009. 10. 28. 11:16 .Net Project/ASP.NET 3.5 Sp1
반응형


                                               UpdateProgress 컨트롤 사용  
FrmUpdateProgress.aspx

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FrmUpdateProgress.aspx.cs"
         Inherits="FrmUpdateProgress" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Update Progress</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
       
        아래에 오래 걸리는 기능 구현          
       
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <asp:Button ID="Button1" runat="server" Text="확인" onclick="Button1_Click" />
                    <br /> 
                    3초 걸리는 작업
            </ContentTemplate>
        </asp:UpdatePanel>
       
        <asp:UpdateProgress ID="UpdateProgress1" runat="server"
                AssociatedUpdatePanelID ="UpdatePanel1">
            <ProgressTemplate>
                <span style="color:Red;">
                로딩중....</span>
            </ProgressTemplate>
        </asp:UpdateProgress>
   
    </div>
    </form>
</body>
</html>



 FrmUpdateProgress.aspx.Cs

using System;
using System.Web.UI.WebControls;

public partial class FrmUpdateProgress : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
          //Empty
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //시간 지연
        System.Threading.Thread.Sleep(3000); //3초 지연

        this.Label1.Text = DateTime.Now.ToLongTimeString();
    }
}


반응형
posted by Magic_kit