C# RedirectToRouteResult可以与RazorGenerator.Mvc一起工作吗?

C# RedirectToRouteResult可以与RazorGenerator.Mvc一起工作吗?,c#,asp.net-mvc,razor,razorgenerator,C#,Asp.net Mvc,Razor,Razorgenerator,我有一个项目,在MVC5.NET4.5.2中有一些视图,然后我在解决方案中添加了第二个MVC项目,该项目使用razorgenerator nuget包预编译视图,以便在第一个项目中使用。接下来,我使用一个自定义的GlobalFilterCollection将其添加到GlobalFilters中,以将用户定向到第一个项目中的视图或第二个项目中的特定视图 在VS2013 IIS Express中本地运行时,此场景非常有效。当我把它放在服务器上,但是WinServer2008,IIS7在javascr

我有一个项目,在MVC5.NET4.5.2中有一些视图,然后我在解决方案中添加了第二个MVC项目,该项目使用razorgenerator nuget包预编译视图,以便在第一个项目中使用。接下来,我使用一个自定义的GlobalFilterCollection将其添加到GlobalFilters中,以将用户定向到第一个项目中的视图或第二个项目中的特定视图

在VS2013 IIS Express中本地运行时,此场景非常有效。当我把它放在服务器上,但是WinServer2008,IIS7在javascript调用时找不到视图,只有最初调用的视图

有什么想法吗

定义的路线:

 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

 routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Index", action = "Index", id = UrlParameter.Optional }
            );
使用的过滤器:

override public void OnActionExecuting(ActionExecutingContext filterContext)
{
    else
    {
        string requestedAction = (filterContext.ActionDescriptor).ActionName;
        string requestedController = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName;

        //If we are already going to the controller action which serves the login view when not logged in, then ignore the filter:
        if ((requestedAction == "Login" || requestedAction == "LoginAction") && requestedController == "DBLogin")
        {
            base.OnActionExecuting(filterContext);
            return;
        }

        var Session = filterContext.HttpContext.Session;

        //If we got here, then another page was requested, so verify the login and change the route if necessary:
        if (Session["IsLoggedIn"] != null && (bool)Session["IsLoggedIn"] == true)
        {
            base.OnActionExecuting(filterContext);
            return;
        }
        else
        {
            RouteValueDictionary reRouter = new RouteValueDictionary();
            reRouter.Add("action", "Login");
            reRouter.Add("controller", "DBLogin");
            filterContext.Result = new System.Web.Mvc.RedirectToRouteResult(reRouter);
        }
    }
}
调用Javascript以请求在IIS上失败的后续视图:

$.support.cors = true;
$.ajax({
    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: SERVER_TO_USE + "/DBLogin/LoginAction",
    data: parameters,
    success: function (data, textStatus, jqXHR) {
        callBackLoginSuccess(data);
    },
    error: function (jqXHR, textStatus, errorThrown) {
        console.log(textStatus);
        console.log(errorThrown);
        hasError = true;
        lastErrorMessage = errorThrown;
    },
    complete: function (jqXHR, textStatus) {
        if (hasError) {
            var errorObject = ErrorHandling.BuildClientSideError(lastErrorMessage);
            ErrorHandling.ShowErrors(errorObject);
        }
    },
    dataType: 'json'
});

这只是url,在本地运行时,我不需要指定域