wyskakujące okno pobierania pliku nie działa

Pracuję nad aplikacją formularzy WWW ASP.NET. Moim wymaganiem jest pokazanie okna pop-up z pobieraniem plików Excela, gdy użytkownik kliknie na dany link (Ten link jest na poppage nie na stronie aspx.). Mam stronę aspx z linkiem. Gdy użytkownik kliknie, wywoła funkcję js, dzięki czemu wywołamy metodę usługi internetowej, aby wygenerować HTML do wyskakującego ekranu.

KOD:

 function showListModelFromGenrator(divId) {
    var lowner = $("#" + hdnLoggedInOwnerID)[0].value;
    var sowner = $("#" + hdnSelectedOwnnerID)[0].value;
    var commID = $("#" + hdnCommunityId)[0].value;


    var controlid = '#' + divId;
    $.ajax({
        url: baseUrl + '/' + "WebServices/ExtraInfoWebService.asmx/GetProductActivityStatus",

        data: { LoggedInOwnerId: lowner, SelectedOwnerId: sowner, CommunityId: commID },
        success: function (response) {
            $(controlid).dialog("destroy");
            $(controlid).dialog({
                autoOpen: false,
                modal: true,
                width: 560,
                height: 370,
                resizable: false

            }).empty().append(response.text);
            $(controlid).dialog('open');
            var busyBox = new BusyBoxWrapper()
            busyBox.HideBusyBoxAfter(5);
        },
        cache: false
    });
}

metoda internetowa:

[WebMethod(EnableSession = true)]
    public string GetProductActivityStatus(int LoggedInOwnerId, int SelectedOwnerId, int CommunityId)
    {
        StringBuilder stringAuditStatus = new StringBuilder();
        Audit objdata = new Audit();
        try
        {
            DataTable dt = new DataTable();
            int ownerID = LoggedInOwnerId;
            if (SelectedOwnerId != 0)
                ownerID = SelectedOwnerId;

            dt = objdata.GetListmodeldata(ownerID, CommunityId);

            stringAuditStatus.Append(@"<table><tr class=addressTableHeader><td>Code</td>" +
                                            "<td>Description</td>" +
                                            "<td>Status</td>" +
                                            "<td>Date</td></tr>");
            foreach (DataRow item in dt.Rows)
            {
                stringAuditStatus.Append(


                                            "<tr><td>" + item["Code"] + "</td>" +
                                            "<td>" + item["Description"] + "</td>" +
                                            "<td>" + item["Status"] + "</td>" +
                                            "<td>" + item["Date"] + "</td></tr>");
            }
            stringAuditStatus.Append("</table>");
            stringAuditStatus.Append("<a id=lnkViewProductCodeStatus runat='Server' href='#' onclick='javascript:ExportExel();'>DownloadListModel</a>");


        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }

        return stringAuditStatus.ToString();
    }

gdy użytkownik kliknie „lnkViewProductCodeStatus” (powyżej utworzony metodą internetową). nazywamy funkcję JSExportExcel który wywołuje metodę obsługi do przetworzenia pliku do pobrania.

function ExportExel(){
    var abc;
    $.ajax({
        type: "POST",
        url: baseUrl + '/' + "WebServices/ExtraInfoWebService.asmx/Urlhttphandler",
        data: {},
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            //window.open(msg.d);
            $.ajax({
                type: "POST",
                url: msg.d,
                data: {},
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg) {
                    //window.open(msg.d);
                }
            });
        }
    });
public void ProcessRequest(HttpContext context)
    {


        string FullFilePath = context.Server.MapPath("~/Certificates/" + "ExcelFile.xls");
        System.IO.FileInfo file = new System.IO.FileInfo(FullFilePath);

        if (file.Exists)
        {
            //For more MIME types list http://msdn.microsoft.com/en-us/library/ms775147%28VS.85%29.aspx
            context.Response.ContentType = MIMETypeUtility.MIMETypeDescription(MIMEType.Excel);
            context.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + file.Name + "\"");
            context.Response.AddHeader("Content-Length", file.Length.ToString());
            context.Response.WriteFile(file.FullName);
            context.Response.Flush();
            context.Response.End();
        }



    }

kiedy debuguję wywołanie aplikacji, trafia poprawnie do hanlder, ale okno pobierania plików nie jest kodem coming.same próbowałem na stronie (nie na popup) działa dobrze.

Wielkie dzięki, Prashant

questionAnswers(1)

yourAnswerToTheQuestion