I have two Asp.Net MVC Websites with two different Asp.Net MVC applications running on the same machine. The first one is inside the root domaindomain.com, and the second one is a subdomainsub.domain.com.
Everything works fine inside the root domain, but I'm having trouble submitting forms to every controller on the subdomain using POST. Whatever I try to send seems never to get to the controller.
It may seem strange but this problem does not happen when I try to start the application locally in debug mode. (locally is not a subdomain, just plain localhost).
Just for testing purposes I've build a simple model:
Even with this simple configuration, on my local copy I've no problem, but as soon as I start the application on the remote machine, the posted data is always empty.
I already tried changing the model name and type (using FormCollection), but the data is always empty.
None
0 Points
2 Posts
Form data always empty in ASP.NET MVC application inside subdomain
Jul 02, 2020 07:39 AM|LightAndrek|LINK
I have two Asp.Net MVC Websites with two different Asp.Net MVC applications running on the same machine. The first one is inside the root domain domain.com, and the second one is a subdomain sub.domain.com.
Everything works fine inside the root domain, but I'm having trouble submitting forms to every controller on the subdomain using POST. Whatever I try to send seems never to get to the controller.
It may seem strange but this problem does not happen when I try to start the application locally in debug mode. (locally is not a subdomain, just plain localhost).
Just for testing purposes I've build a simple model:
This is the CSHTML partial view:
And this is the test controller:
Even with this simple configuration, on my local copy I've no problem, but as soon as I start the application on the remote machine, the posted data is always empty.
I already tried changing the model name and type (using FormCollection), but the data is always empty.
What do you think could be the problem?
All-Star
58124 Points
15640 Posts
Re: Form data always empty in ASP.NET MVC application inside subdomain
Jul 02, 2020 02:28 PM|bruce (sqlwork.com)|LINK
I would do a network trace to see the post data and any redirects.
None
0 Points
2 Posts
Re: Form data always empty in ASP.NET MVC application inside subdomain
Jul 02, 2020 03:04 PM|LightAndrek|LINK
I think I cannot do this since because it's on a plesk shared hosting.
All-Star
58124 Points
15640 Posts
Re: Form data always empty in ASP.NET MVC application inside subdomain
Jul 03, 2020 02:17 PM|bruce (sqlwork.com)|LINK
You do it from the computer with the browser. You care about what the browser sees.