无法想象这个问题还没有被问到……虽然,我找不到它.
所以这就是:我在ASP.NET MVC 3中的动作方法上使用了ActionNameAttribute.像这样:
[ActionName("confirm")] [HttpGet] public ActionResult Confirm(string stuffTitle) { ActionResult resultView = CreateSomeStuff(stuffTitle); return resultView; }
但是,我怎样才能为课程做同样的事情呢?像这样:
[ActionName("personal")] public class AccountController : Controller
使用ActionNameAttribute只能在方法声明中使用.但我想它应该在类类型声明上以某种方式可行.也许我还没有听说过另一个属性?其他一些解决方法?
有人有想法吗?提前致谢!!