Problem with AJAX in C# application on IIS

Paweł Paluch 20 Reputation points
2024-09-17T08:42:05.41+00:00

I am facing issues with AJAX in my C# application running on IIS. The application works fine on the local environment and test environment, but AJAX functionality fails on the server. I have checked the Request Filter and unlocked some .cs and .csproj files, but there are no server logs generated. Can someone help me troubleshoot this issue?

Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,004 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,526 Reputation points Microsoft Vendor
    2024-09-18T07:36:57.2133333+00:00

    @Paweł Paluch

    Here are a few troubleshooting steps to resolve the AJAX issue in your C# application on IIS:

    1. Check the AJAX Request URL: ensure that the AJAX URL is correct in the production environment. Sometimes relative URLs behave differently on different environments. If you're using relative paths, try switching to absolute paths.
    2. Check Server Permissions: verify that the IIS server and application pool have sufficient permissions to access the required resources. This includes file system permissions, database access, or external API access.
    3. AJAX Timeouts: If requests are timing out in production but working in test/local, there may be a server performance issue or a configuration limiting request execution time.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MotoX80 33,461 Reputation points
    2024-09-17T11:50:12.2766667+00:00

    In Edge on the client, press F12 to launch the developer tools. Click on the Network icon. Recreate the problem and analyze the network traffic for issues.

    https://www.bing.com/search?pglt=41&q=msedge+developer+tools+network

    User's image

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.