나는 버튼을 내 aspx 페이지에 두 개의 레이블, 난 라벨에 텍스트를 표시하고 몇 초 후에 내가 버튼을 클릭에 다른 텍스트 번째 레이블을 채우기 위해 싶습니다 싶습니다이 내 코드 소스 파일레이블을 채우기 위해 asp.net에서 멀티 스레딩을 관리하는 방법은 무엇입니까?
입니다 나는 두 가지 반응을 얻고있다<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblFirst" runat="server" Text=""></asp:Label>
<asp:Label ID="lblSecond" runat="server" Text=""></asp:Label>
<asp:Button ID="btnFirst" runat="server" Text="First"
onclick="btnFirst_Click" />
</ContentTemplate>
</asp:UpdatePanel>
및 코드 파일
protected void btnFirst_Click(object sender, EventArgs e)
{
first();
second();
}
private void first()
{
I am Calling a method form my class file which returns a string , and assigning to label first
//class1 obj=new class1();
//string result=obj.first()
// lblFirst.Text =result;
}
private void second()
{
I am Calling a method form my class file which returns a string , and assigning to label Second
//class2 obj=new class2();
//string result1=obj.Second()
lblSecond.Text = result1;
}
, 내가 두 번째 응답과 후방을 기다리지 않고 내가 먼저 도착하는 표시 할 것 어 두 번째 응답이 첫 번째 응답을 잃지 않고 즉시 표시됩니다지고, pls는 같은 출력
감사 hemanth이
웹 앱에서'Thread.Sleep'을 볼 때마다 나는 강아지를 걷어차 기 시작합니다. 대신 클라이언트 측에서 해보십시오. 서버에서 페이지를 업데이트하는 것은 수행 할 수있는 경우 수행해야 할 모든 문제를 해결할 가치가 없습니다. – cHao