在我的路线上,我有这样的事情:
controller/action/{id}
据我所知,这意味着它将调用具有参数id的任何操作,如下所示:
public ActionResult Detail(string id)
{
}
在不将特定路由注册到global.asax文件中的情况下,我该怎么做才能进行以下工作:
public ActionResult Detail(string customerId)
{
}
最佳答案
使用类似-controller/action/{customerId}的路由,或者只是将参数customerId
重命名为id
,然后以所需的特定方式使用它。
关于asp.net-mvc - 在ASP.NET MVC中,如何更改操作参数并使它正常工作而不更改路由?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4749499/