Making Asynchronous Calls to WCF Services from ASP.NET을 확인하십시오. 이 같은
뭔가 : 귀하의 빠른 회신
protected void Button1_Click(object sender, EventArgs e)
{
PageAsyncTask pat = new PageAsyncTask(BeginProductRetrieveAsync, EndProductRetrieveAsync, null, null);
Page.RegisterAsyncTask(pat);
}
IAsyncResult BeginProductRetrieveAsync(object sender, EventArgs e, AsyncCallback acb, object extraData)
{
nor = new ProductReference.NorthwindServiceClient();
return nor.BeginProductList(acb, extraData);
}
void EndProductRetrieveAsync(IAsyncResult ar)
{
var prods = new List<Products>();
ListBox1.DataSource = nor.EndProductList(ar);
ListBox1.DataTextField = "ProductName";
ListBox1.DataValueField = "ProductID";
ListBox1.DataBind();
}
감사합니다 .. 페이지의 작업을 잘 ...하지만 지금은 내 응용 프로그램에서 나는 데 더 많은 숫자입니다. 그것은 모든 페이지에서 ServiceObject를 생성해야한다는 것을 의미합니다. – hima