How do I get the Controller and Action names from the Referrer Uri?

前端 未结 9 1054
清歌不尽
清歌不尽 2020-12-01 14:06

There\'s a lot of information for building Uris from Controller and Action names, but how can I do this the other way around?

Basically, all I\'m trying to achieve i

9条回答
  •  猫巷女王i
    2020-12-01 14:21

    @gordon's solution works, but you need to use

     return RedirectToAction(actionName.ToString(), controllerName.ToString(),values);
    

    if you want to go to previous action

提交回复
热议问题