54

If I want to directly access the RouteData (the current action or parameter values for example) from the View, rather than having to pass it in from the controller as part of the ViewData, what class would i use?

amiry jd
  • 27,021
  • 30
  • 116
  • 215
Gene Reddick
  • 4,655
  • 4
  • 34
  • 35

1 Answers1

101
this.ViewContext.RouteData

should do the trick.

womp
  • 115,835
  • 26
  • 236
  • 269