我正在做下面这样的调用clikc上的asyn
private List<SuggestedItemsInput> suggestedItemAsync()
{
OHDWebService OHDService = new OHDWebService();
List<SuggestedItemsInput> suggestedItemsList = OHDService.SaveSuggestedItems(ViewState["Body"].ToString(), hfdOrderRecordID.Value);
return suggestedItemsList;
}
onclick
protected async void imgbtnClaim_Click(object sender, EventArgs e)
{
try
{
Task<List<SuggestedItemsInput>> task = new Task<List<SuggestedItemsInput>>(suggestedItemAsync);
task.Start();
lblError.Text = "Please Wait. Proccessing...";
List<SuggestedItemsInput> suggestedItems = await task;
if (suggestedItems.Count > 0)
{
但它是阻塞的UI,thousing错误如下
如何才能做到这一点?
1条答案
按热度按时间alen0pnh1#
创建一个像这样的webmethod:
然后从你的前端使用jquery来点击这个方法,像这样:
希望有帮助。