G
Guest
Hello,
I have an ASP.Net webform that shows numerous attributes of parts we sell.
There is one portion of the form that I have the user click a button to get
the information for. I did this for two reasons: 1) not everyone wants to
see it every time. 2) Depending on the complexity of the part, it can take a
while.
Everything works great. However, on complex parts (say that return 10,000 +
lines) the browser says it is "Not Responding" but I know I just have to
wait. I then did some research and it sounds as if I make an Asynchronous
call to the WebService method, I would not get the Not Responding issue.
So here is my code when they click the button to get the information...
private void Button1_Click(object sender, System.EventArgs e) {
dgrdBOM.Visible = true;
AsyncCallback cb = new AsyncCallback(this.QueryCallback);
IAsyncResult ar = oWS.BeginGetItemBOM(iUniqueID, iOrganizationID, 1,
cb, oWS);
lablTest.Text = "Kevin";
}
I threw the lablTest in there to make sure it at least gets that far and it
does. Here is the callback function.
public void QueryCallback(IAsyncResult ar) {
PartExplorerWS.PartInfo oWS2 = (PartExplorerWS.PartInfo) ar.AsyncState;
DataSet dsResults;
lablTest.Text = "Here";
dsResults = oWS2.EndGetItemBOM(ar);
dgrdBOM.DataSource = dsResults;
dgrdBOM.DataBind();
dgrdBOM.Visible = true;
}
I never get the lablTest to update to "Here" The specific query I am
running should only take about 1-2 seconds in this test case. Am I missing
something?
TIA,
Grigs
I have an ASP.Net webform that shows numerous attributes of parts we sell.
There is one portion of the form that I have the user click a button to get
the information for. I did this for two reasons: 1) not everyone wants to
see it every time. 2) Depending on the complexity of the part, it can take a
while.
Everything works great. However, on complex parts (say that return 10,000 +
lines) the browser says it is "Not Responding" but I know I just have to
wait. I then did some research and it sounds as if I make an Asynchronous
call to the WebService method, I would not get the Not Responding issue.
So here is my code when they click the button to get the information...
private void Button1_Click(object sender, System.EventArgs e) {
dgrdBOM.Visible = true;
AsyncCallback cb = new AsyncCallback(this.QueryCallback);
IAsyncResult ar = oWS.BeginGetItemBOM(iUniqueID, iOrganizationID, 1,
cb, oWS);
lablTest.Text = "Kevin";
}
I threw the lablTest in there to make sure it at least gets that far and it
does. Here is the callback function.
public void QueryCallback(IAsyncResult ar) {
PartExplorerWS.PartInfo oWS2 = (PartExplorerWS.PartInfo) ar.AsyncState;
DataSet dsResults;
lablTest.Text = "Here";
dsResults = oWS2.EndGetItemBOM(ar);
dgrdBOM.DataSource = dsResults;
dgrdBOM.DataBind();
dgrdBOM.Visible = true;
}
I never get the lablTest to update to "Here" The specific query I am
running should only take about 1-2 seconds in this test case. Am I missing
something?
TIA,
Grigs