首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Response.Redirect未求值

Response.Redirect未求值
EN

Stack Overflow用户
提问于 2013-02-13 04:13:07
回答 1查看 109关注 0票数 0

我的Default.aspx页面上有以下用于登录的ajax脚本

代码语言:javascript
复制
$(document).ready(function () {
    $('#UserLogin').submit(function (e) {
        $.post("LoginApp.aspx?formpost=Login", { UserID: $("#UserID").val(),
            UPass: $("#UPass").val()
        },
        function (response) {
            if (response === "failed") {
                $("#ErrorDiv").html(response).show();
                // LocalStorage.set('Error', response);
            }
        });

        e.stopPropagation();
        return false;
    });
});

和下面的FormAuth

代码语言:javascript
复制
 If Request.QueryString("formpost") = "Login" Then

    If App.LoginUser(Request.Form("UserID").Trim, Request.Form("UPass").Trim) Then

        FormsAuthentication.RedirectFromLoginPage(Request.Form("UserID").Trim, False)
        If Request.QueryString("ReturnUrl") <> "" Then
            Response.Redirect(Request.QueryString("returnUrl"))
        Else
            Try
                Response.Redirect("secured/")     
            Catch ex As Exception

            End Try

        End If
    Else
        Response.Write("failed")
    End If
Else

    Response.Redirect(".")

End If

问题是Response.Redirect("secured/")不起作用。

任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-13 04:26:30

你必须处理来自javascript的重定向。由于您没有执行回发,因此服务器永远不会完全控制页面。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14840966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档