Jquery 当ajax操作为[授权]时,登录页面显示UpdateTargetId内部

Jquery 当ajax操作为[授权]时,登录页面显示UpdateTargetId内部,jquery,c#-4.0,asp.net-mvc-4,Jquery,C# 4.0,Asp.net Mvc 4,我有一个AJAX表单&一个对应于该表单的动作方法。我要保留[授权]这张表格 AJAX表单: @using (Ajax.BeginForm("Vote", "Rate", null , new AjaxOptions { InsertionMode = InsertionMode.Replace,

我有一个AJAX表单&一个对应于该表单的动作方法。我要保留[授权]这张表格

AJAX表单:

     @using (Ajax.BeginForm("Vote", "Rate", null ,
                       new AjaxOptions
                           {
                               InsertionMode = InsertionMode.Replace,
                               HttpMethod = "GET",
                               OnFailure = "searchFailed",
                               LoadingElementId = "ajax-loader",
                               UpdateTargetId = "searchresults",
                           },new { id = "voteForm" }))
                {
                <input type="radio" name="Stars" value="1">
                <input type="radio" name="Stars" value="2">
                <input type="radio" name="Stars" value="3">
                <input type="submit" value="Vote" />
                }

当我单击Submit按钮时,登录页面显示在UpdateTargetId(searchresults)中,但它需要在新窗口中显示

这是因为您正在执行一个Ajax操作,所有结果都将反映在
UpdateTargetId

因此,您应该使用服务器的responseText在
OnFailure
OnSuccess
方法中检查用户未经授权的特殊情况,并使用javascript将用户重定向到登录页面,即

location.href = '/login';

对不起,我没弄明白。它激发了成功的方法。但我无法确定它是否经过身份验证。
location.href = '/login';