T
TC
Hello,
I am making an asynchronous call to a webservice and trying to update the
web page with the results.
The page is not updating.
Does anybody know why???
Below is my code:
public class ASPNetSuperhero : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList drplstFilePaths;
protected System.Web.UI.WebControls.TextBox txtMessage;
protected System.Web.UI.WebControls.Button btnStartFileSearch;
private localhost.ASPNetSuperheroService GetWordCount;
protected System.Web.UI.WebControls.Label lblWordCount;
private AsyncCallback MyWordCountCallback;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnStartFileSearch.Click += new
System.EventHandler(this.btnStartFileSearch_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnStartFileSearch_Click(object sender, System.EventArgs e)
{
MyWordCountCallback = new AsyncCallback(WordCountCallback);
/* Create new instance of the webservice that provides
the required functionality*/
GetWordCount=new localhost.ASPNetSuperheroService();
GetWordCount.BeginWordCount(MyWordCountCallback,GetWordCount);
}
private void WordCountCallback(IAsyncResult Result)
{
// Call the webservice method in order to get current word count
this.txtMessage.Text=GetWordCount.EndWordCount(Result);
}
}
Regards,
TC
I am making an asynchronous call to a webservice and trying to update the
web page with the results.
The page is not updating.
Does anybody know why???
Below is my code:
public class ASPNetSuperhero : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DropDownList drplstFilePaths;
protected System.Web.UI.WebControls.TextBox txtMessage;
protected System.Web.UI.WebControls.Button btnStartFileSearch;
private localhost.ASPNetSuperheroService GetWordCount;
protected System.Web.UI.WebControls.Label lblWordCount;
private AsyncCallback MyWordCountCallback;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnStartFileSearch.Click += new
System.EventHandler(this.btnStartFileSearch_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnStartFileSearch_Click(object sender, System.EventArgs e)
{
MyWordCountCallback = new AsyncCallback(WordCountCallback);
/* Create new instance of the webservice that provides
the required functionality*/
GetWordCount=new localhost.ASPNetSuperheroService();
GetWordCount.BeginWordCount(MyWordCountCallback,GetWordCount);
}
private void WordCountCallback(IAsyncResult Result)
{
// Call the webservice method in order to get current word count
this.txtMessage.Text=GetWordCount.EndWordCount(Result);
}
}
Regards,
TC