我希望使用属性\Filter构造函数内部的ControllerContext或ActionContext的信息。我怎样才能做到呢?尝试将ControllerContext作为参数从操作传递给属性,但没有成功。
发布于 2014-02-26 15:35:00
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var controllerContext = filterContext.Controller.ControllerContext;正在执行中。不能使用构造上下文
发布于 2017-05-14 08:36:05
[HttpGet]
public ActionResult VideoStream(int id = 0)
{
}
public override void ExecuteResult(ControllerContext context)
{
string routedata = context.RequestContext.RouteData.Values["id"].ToString();
//The File Path
var videoFilePath = HostingEnvironment.MapPath("~/CombineFile/Tanvir.mp4");
//The header information
} https://stackoverflow.com/questions/22045589
复制相似问题