reflection - Accessing the list of Controllers/Actions in an ASP.NET MVC application -


We know that behind the scenes, the ASP.NET MVC framework will use the restriction to determine which Administrators / actions are available executed, which comes from the classes System.Web.Mvc.Controller , and based on those classes, which returns an ActionResult object .

To my question - is it possible to access the list of controllers / functions from within my MVC application?

(I can do it myself, using reflection on the current assembly, but if the list is already created by ASP.Net MVC, I try to find myself again and again I want to use it again.)

New Reflected Controller Descriptor (Typef (Tc Controller) ). GetCanonicalActions () will return a collection of action descriptor objects displaying all the actions on the controller. It is not very clever to understand things like selection characteristics or naming characteristics, so with every kind of action it is not guaranteed to be web-collage. But if you need to perform actions directly, you can call ActionDescriptor.Execute () for any interest.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -