Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am not getting the "type: "Post"".

Is it from the "Submit" button from a previous webpage?
JavaScript
<script type="text/javascript">
    function GetDateTime() {
                    var params = "{'msg':'From Client'}";
                    $.ajax
                      ({
                          type: "POST",
                          url: "Default.aspx/GetServerDateTime",
                          data: params,
                          contentType: "application/json;charset=utf-8",
                          dataType: "json",
                          success: function (result) {
                              alert(result.d);
                          },
                          error: function (err) {

                          }
                      });
    }
</script>
Posted

1 solution

POST method would just remove the QueryString from the URL but however will still send the request to the server alongwith the form data.

You can see the the Request Method to be changed to POST if this is the code that is creating the request to the server. Otherwise, if your form is submitting automatically, make sure the method="post" is set on the form to get a POST type request on the server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900