ASP.NET MVC: How do I output the Controller and View that is currently being rendered? -



ASP.NET MVC: How do I output the Controller and View that is currently being rendered? -

i have complicated set of routes , need edit specific web page. given url, how determine controller , view created page?

i'm open using asp.net mvc write info straight page textcolor== background color, or else may recommend.

i'd solution can utilize in production (where mvc route debugger disabled)

you can access controller , action straight through viewcontext.

// asp.net mvc 3 viewcontext.controller.valueprovider.getvalue("controller").rawvalue viewcontext.controller.valueprovider.getvalue("action").rawvalue // asp.net mvc 2 , below: viewcontext.controller.valueprovider["controller"].rawvalue viewcontext.controller.valueprovider["action"].rawvalue

to view, have @ answer similar question phil haack.

asp.net-mvc asp.net-mvc-3 routes

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -