0

When I submit a form my browser goes to here:

Administration/Member/Navigate?personid=1771&type=Information

When it should go here:

Administration/Member/Navigate?personid=1771&type=Information

The way I call the submit seems ordinary:

$("#user-form").submit();

Probably not related, but we've recently converted from aspx to razor. This has caused a lot of artifacts 'like this' to show up. It looks like the extra characters are coming from jQuery, though.

Edit:

I mistakenly thought the submit() call went right into the jQuery library (seemed to be the case when I was stepping through it), but there also seems to be this function:

    $("#user-form").submit(function () {
        var isValid = $("#user-form").valid();
        if (isValid)
        {

            $.ajax({
                type: "POST",
                url: "/UserManagement/ClassUser/Edit",
                data: $("#user-form").serialize(),
                success: function (id) { 
                    window.location.href = returnUrl; 
               },
                error: function(xhr, textStatus, error) {
                    showAlert("Error Saving User", xhr.responseText);
                }
            });

        }

        return false;
    });

Apparently the returnUrl variable had some extra encoding in it.

The answer appears to be here:

Url.Action puts an & in my url, how can I solve this?

Community
  • 1
  • 1
micahhoover
  • 2,101
  • 8
  • 33
  • 53
  • Can you share the HTML form and the full JS code? – mjswensen Mar 09 '15 at 13:10
  • It might be some encoding going on, please share your code – Sim1 Mar 09 '15 at 13:13
  • You haven't shown how you generate that URL, without it this question can't be answered. – Liam Mar 09 '15 at 13:13
  • 2
    Those are not extra characters, razor encodes some characters. It is url encode of character '&'. Please share some code to understand better. – BabyDuck Mar 09 '15 at 13:14
  • 1
    It's perfectly legit to [answer your own question you know?](http://meta.stackexchange.com/questions/17463/can-i-answer-my-own-questions-even-if-i-knew-the-answer-before-asking) – Liam Mar 09 '15 at 14:02

0 Answers0