Aspx page in MVC3

后端 未结 2 1312
执笔经年
执笔经年 2021-01-24 12:58

I am developing an MVC3 application using Visual Studio 2010.

I have an aspx page that I want to display as a result of a controller action.

I added this action

2条回答
  •  无人及你
    2021-01-24 13:53

    Easy way to use aspx page on mvc controller for rdlc view

    public ActionResult RdlcReport( )
    {
        IHttpHandler page = (IHttpHandler)System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath("~/Report/ReportDataViewer.aspx", typeof(Page));
        HttpApplication controllerContextHttpContextGetService = (HttpApplication)ControllerContext.HttpContext.GetService(typeof(HttpApplication));
        page.ProcessRequest(controllerContextHttpContextGetService.Context);
        return new EmptyResult();
    }
    

提交回复
热议问题