1

I used to export data as excel files on server side, now I am trying to do it by using webservices.

[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void exportProduct(parameters)
{
    // ... other code ...
    ExportToExcel(ds.Tables[0], filename);
}

public static void ExportToExcel(object x, string filename)
{
    // ... other code ...
}   

But I am getting this error:

Thread was being aborted

However, everything works just fine when I try this URL:

http://localhost:37407/WebServices/WebServiceProduct.asmx?op=exportProduct

Something must be wrong between client-side and the webservice, but I couldn't find it.

Here's the client-side code. I have been just calling webservice but that's all.

function exportToExcel() {
    webService._staticInstance.exportProduct(orderby, filter, function() {
    });
}
Keith Gaughan
  • 21,367
  • 3
  • 32
  • 30
Adem Ergun
  • 79
  • 1
  • 6
  • In which part of the code are you getting the error... Post that part of code – Bhavik May 15 '14 at 17:08
  • in "public static void ExportToExcel(object x, string filename)" part. actually this part in an external cs file. I call it in webmethod, excel file is created in ExportToExcel method and then I am getting error. – Adem Ergun May 15 '14 at 17:13
  • You must check this answers.. http://stackoverflow.com/a/1433486/2260614 and http://stackoverflow.com/a/7630466/2260614 – Bhavik May 15 '14 at 17:19

0 Answers0