79261634

Date: 2024-12-08 00:10:09
Score: 1.5
Natty:
Report link

Beware of "Friendly URLs"!

@Aravamudan's response was the solution to my problem. My website (via my web.config file) was using "Friendly URLs" (via the IIS URL Rewrite 2.0 module). I had previously designed my "Friendly URLs" to remove file extensions from webpage URLs (eg, "foobar.aspx" showed up as "foobar" on the browser's address line). However, these "Friendly URLs" were also converting my "POST" requests into "GET" requests. These HTTP Method conversions were nullifying my HTML-POST-to-ASPX functionality.

So, the simple solution was for me to just exclude the ".aspx" file extension from my HTTP POST requests.

Longstoryshort, to add a nuanced solution to the question... you can POST data from an HTML form to an ASPX page with the following adjustment:

POST | HTML Form to ASPX

Moreover, you can POST data from AJAX to an ASPX page with the following adjustment:

POST | AJAX to ASPX

I hope that helps you.

footnote: I would've written this 'answer' as a comment under @Aravamudan's answer, but I don't have enough reputation points (43 out of 50). So, I just upvoted his (which, unfortunately, was at a -1); and fleshed out these additional details.

Reasons:
  • Blacklisted phrase (0.5): upvote
  • Whitelisted phrase (-1): hope that helps
  • RegEx Blacklisted phrase (1.5): I don't have enough reputation points
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Aravamudan's
  • User mentioned (0): @Aravamudan's
  • Low reputation (1):
Posted by: Elias