0

I have a very small mvc application with 2 text boxes and few buttons. When user clicks on any button, data will be retrieved against particular value entered in text box.

But when I hosted it into the IIS server, its working only when I logged into the server remotely from my local machine, as soon as close the remote connection its giving error as "Data Not found".

In the coding I am displaying this error(Error Panel with ID #ErrorMessage) when we really don't have data and for any other exception as well. Please find my below code and advice why its working only when I remotely logged into the server

 $.ajax({
                url: "@Url.Action("DownloadForms", "Home")" ,
                type: "POST",
                data: { transactionType: btnType, QuotationNumber: quotNumber, ContractNumber: contractNumber},
                cache: false,
                async: true,
                success: function (data) {
                    $('#divBlock').hide();
                    if (data != "") {
                        var _baseUrl = "@Url.Action("Download", "Home")" + "?FileVirtualPath=" + data;
                        window.location = _baseUrl;
                    }
                    else {
                        $("#ErrorMessage").css("display", "block");
                        $('#ldDialog').trigger('click');

                        ev.stopPropagation();
                        return false;
                    }
                },
                error: function (data) {
                    $('#divBlock').hide();
                    $("#ErrorMessage").css("display", "block");
                    $('#ldDialog').trigger('click');
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • 2
    That usually indicates that you didn't configure a valid application pool identity (to connect to the database). Log server side unhandled exceptions, and they should tell. – Lex Li Dec 25 '19 at 14:32
  • I suggest you could also checked the event viewer's application log to find out some useful information. – Brando Zhang Dec 26 '19 at 01:59

1 Answers1

0

The solution for this problem is, we just need to set the identity in component services of the server in which our application is hosted.

For example go to Start-->Component Services-->Microsoft Excel (or word)-->Properties-->Identity-->Set credentilas for This User(of user configured in IIS)

ASP.Net Com-InterOp Excel Generation issue when hosting