1.新建aspx文件

MVC中加载aspx

2.在控制器中访问aspx页面

    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            DbContextBase db = new DbContextBase();
            var list=db.ServiceCategoryNavTBs.ToList();
            return View();
        }
        public ActionResult Report()
        {
            string aspx = "/AspNets/RdlcView.aspx";
            using(var sw=new StringWriter())
            {
                System.Web.HttpContext.Current.Server.Execute(aspx, sw, true);
                return Content(sw.ToString());
            }
        }
    }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2021-07-26
  • 2022-12-23
  • 2021-08-25
猜你喜欢
  • 2021-06-11
  • 2022-12-23
  • 2022-02-24
  • 2022-01-05
  • 2022-12-23
相关资源
相似解决方案