asp.net mvc 4 - Jquery $.post not working mvc4 -


i'm having trouble posting formdata controller. i'm trying implement wizard in mvc4 application, wizard based on sample project nadeem afana (http://afana.me/post/create-wizard-in-aspnet-mvc-3.aspx). have downloaded sample project , it's working great. in project code working fine except 1 thing, 'post' not working (while submit later working).

i've isolated variables, , fine me if @ them in debugger in firefox

var data = $("form").serialize(); var url = '@url.action("confirm", "product")';  $.post(url, data, function (r) {     // inject response in confirmation step     $(".wizard-step.confirm").html(r); }); 

however, action on specified controller isn't begin called (i've put breakpoint on it)

[httppost] public actionresult confirm(productmodel model) {    // code ...    return partialview(model); } 

i have tried

$.post("/product/confirm", $("form").serialize(), function (r) 

using url instead of @url.action ... no change.

for life of me cannot figure out i'm doing wrong or i'm missing, i've been googling searching trying whole afternoon.

you need install fiddler (http://fiddler2.com/) , use see request being made (if any) , why it's failing. in experience trying fix ajax issues without sort of tool fiddler practically impossible , big time sync...


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -