asp.net mvc中如何获取Controller名和action名
我要写个添加的方法:方法中要添加三个字段,(productid,controller,action)
每次浏览页面时都要获取该页面的controller名字和action名字,再添加到表中。
public class GetMassege
{
public GetMassege(int id)
{
添加方法;
}
}
在controller页面中调用该方法检测
[GetMassege(1)]
public ActionResult Create()
{
.......
}
我现在要怎么获取每次浏览页面的controller名字和action名字???