开发者

Jquery Post Not Calling Page

开发者 https://www.devze.com 2023-01-26 02:36 出处:网络
Good morning! I have a user login page \"/Account/Login.aspx\" which uses a custom I\'ve included antag for the user to reset their password - <a href=\"javascript:ConfirmPasswordChange();\">F

Good morning!

I have a user login page "/Account/Login.aspx" which uses a custom I've included an tag for the user to reset their password - <a href="javascript:ConfirmPasswordChange();">Forgot Password?</a>

My post doesn't call my page "/Account/LoginMethods.aspx" (No breakpoint firing), but instead returns the result as the entire content of the user login page "/Account/Login.aspx" html开发者_运维知识库

<script language="javascript" type="text/javascript">
            function ConfirmPasswordChange() {
                $("#ConfiormPasswordReset").dialog({
                    modal: true,
                    autoOpen: false,
                    autoResize: true,
                    title: "Reset Password",
                    draggable: true,
                    buttons: {
                        'Cancel': function () {
                            $(this).dialog("close");
                        },
                        'Continue': function () {
                            SendNewPassword();
                        }
                    }
                }).dialog("open");
                $('#ConfiormPasswordReset').focus();
            }

            function SendNewPassword() {
                $.post("/Account/LoginMethods.aspx", { UserEmail: $("#UserName").val() },
                    function (result) {
                        alert(result);
                    });
                $('#ConfiormPasswordReset').dialog("close");
            }
    </script>

Any Idea of the possible problem?


It's likely that your LoginMethods.aspx page is rejecting the request, redirecting back to Login.aspx because you're lacking credentials. When you make an AJAX request, XmlHttpRequest transparently follows redirects, so it'll spit out whatever it finally ended up being redirected to.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号