I have a shared master view for all my other views. It's in this master view I show the menu. Now I need to find out in what controller I'm currently in so I can disable/enable certain menu options.
For example it should be possible to press the "foo" link if I'm current in the "foo" controller.
How Can I do this?
You can find it with the viewcontext
Could you use?
<%=Html.ViewContext.RouteData.GetRequiredString("controller") %>
Kindness,
Dan
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With