淘先锋技术网

首页 1 2 3 4 5 6 7

1.新建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

 

转载于:https://www.cnblogs.com/liandy0906/p/7936048.html