Note that there are some explanatory texts on larger screens.

plurals
  1. POajax post working locally but not when deployed
    primarykey
    data
    text
    <p>Can anyone see anything i m doing wrong with this as its driving me a bit mad (not sure if it friday brain or baby brain) anyway...</p> <p>I have a Ajax post which works fine locally but doesnt work when i deploy to another server.</p> <p>I've put lots of alerts in to make sure I'm getting the parameters that i expect so not quite sure whats missing.</p> <p>Here is the ajax post:</p> <p>View:</p> <pre><code> var theUrl = "/Widgets/TestBin2AutomationResults/" + widgetImpressionId + "/" + retailerProductId + "/" + quantity; alert("widgetImpressionId" + widgetImpressionId); alert("retailerProductId" + retailerProductId); alert("quantity" + quantity); alert(theUrl); $("#imgaddtocart").hide(); $("#addMe").unbind('click'); $("#delete").unbind('click'); $.ajax({ type: "POST", url: theUrl, data: { 'username': username, 'password': password }, dataType: "json", success: function (data) { if (data != null) { alert("we are inside data"); </code></pre> <p>Controller:</p> <pre><code> [JsonpFilter] [AcceptVerbs(HttpVerbs.Post)] public JsonResult TestBin2AutomationResults(int widgetImpressionId, int retailerProductId, int quantity, string username, string password) { MessageBox.Show("We are inside TestBin2Automation controller " + widgetImpressionId + "/" + retailerProductId + "/" + quantity + "/" + username + "/" + password); </code></pre> <p>Global.asax</p> <pre><code> routes.MapRoute("Bin2SubmitTestBin2Automation", "Widgets/TestBin2AutomationResults/{widgetImpressionId}/{retailerProductId}/{quantity}", new { controller = "Widgets", action = "TestBin2AutomationResults", widgetImpressionId = 0, retailerProductId = 0, quantity = 0, username = "", password = "" }); </code></pre> <p>I'm not getting into the controller as the MessageBox.Show isn't displaying.</p> <p>Any help appreciated it d be nice to not have this hanging over my head all weekend!</p> <p>Many thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload