Post data from One Web App (external) to Another Web App hosted in Azure App service

Mathew James 336 Reputation points
2023-04-24T12:13:22.64+00:00

Hi Everyone - I am in the process of implementing a payment gateway. Once the transaction is complete, they post the details to our Web page (Webform aspx) hosted in Azure App service. Due to some reason, I am unable to retrieve the data they have Posted in my page. Tried Request.Form ["status"] and I am unable to get any value there. For CORS - I have already added their domain in Allow CORS in App service. Am i missing anything further ? Thanks! -Mathew

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,312 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,032 questions
{count} votes

Accepted answer
  1. Lan Huang-MSFT 26,516 Reputation points Microsoft Vendor
    2023-04-27T08:03:18.0966667+00:00

    Hi @Mathew James,

    I am not receiving the posted data. Always I get null in test1. Please let me know whether I am missing anything ?

    I tested your code and found that the problem is with the Friendly URLs. You can try the following two methods:

    1. Update the form's action to remove the file extension <form id="form1" method="post" action="statusdisplay" >
    2. Amend the configuration for Friendly URLs You will find this in the RouteConfig.cs file in the App_Start folder. The configuration to change is the AutoRedirect mode which by default is set to RedirectMode.Permanent.
     public static void RegisterRoutes(RouteCollection routes)
            {
                var settings = new FriendlyUrlSettings();
                //settings.AutoRedirectMode = RedirectMode.Permanent;
                routes.EnableFriendlyUrls(settings);
            }
    

    Best regards,
    Lan Huang


    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 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more